Skip to content

Instantly share code, notes, and snippets.

View ryondev's full-sized avatar
🎯
Focusing

Ryon ryondev

🎯
Focusing
  • TikTok Inc.
  • San Jose
View GitHub Profile
@ryondev
ryondev / ChangePassword.java
Created March 7, 2018 14:54 — forked from zach-klippenstein/ChangePassword.java
The keystore password on Java keystore files is utterly pointless. You can reset it without knowing it, as shown by this code. Note that private keys are still secure, as far as I know. The JKS implementation is copyright Casey Marshall ([email protected]), and the original source is available at http://metastatic.org/source/JKS.java. I've in…
import java.util.*;
import java.io.*;
import java.security.*;
public class ChangePassword
{
private final static JKS j = new JKS();
public static void main(String[] args) throws Exception
{
@ryondev
ryondev / gist:5a69824c001bae47a69a5e6fe9db3410
Created February 10, 2018 13:25 — forked from Nyx0uf/gist:217d97f81f4889f4445a
UIImage scale using vImage
-(UIImage*)mmg_imageScaledToFitSize:(CGSize)fitSize
{
// Create a vImage_Buffer from the CGImage
CGImageRef sourceRef = self.CGImage;
vImage_Buffer srcBuffer;
vImage_CGImageFormat format = {
.bitsPerComponent = 8,
.bitsPerPixel = 32,
.colorSpace = NULL,
.bitmapInfo = (CGBitmapInfo)kCGImageAlphaFirst,