Skip to content

Instantly share code, notes, and snippets.


Sungcheol Kim skyfe79

View GitHub Profile
skyfe79 /
Created Apr 10, 2020 — forked from arielweinberger/
Strong password Regular Expression - NestJS Course
  • Passwords will contain at least 1 upper case letter
  • Passwords will contain at least 1 lower case letter
  • Passwords will contain at least 1 number or special character
  • There is no length validation (min, max) in this regex!

Regular expression for JavaScript:

skyfe79 / diff.mdown
Created Mar 1, 2019 — forked from ndarville/diff.mdown
Paul Heckel's Diff Algorithm
View diff.mdown

[Isolating Differences Between Files][paper]

Advantage over Other Algorithms

The diff output is more specific:

[I]f a whole block of text is moved, then all of it, rather than just the beginning and end, is detected as changed.

The algorithm described here avoids these difficulties. It detects differences that correspond very closely to our intuitive notion of difference.

skyfe79 / StringExtensionHTML.swift
Created Nov 20, 2018
Decoding HTML Entities in Swift
View StringExtensionHTML.swift
import Foundation
// Very slightly adapted from
// 99.99% Credit to Martin R!
// Mapping from XML/HTML character entity reference to character
// From
private let characterEntities : [String: Character] = [
skyfe79 / makeAnimatedGif.m
Created Nov 2, 2017 — forked from mayoff/makeAnimatedGif.m
Example of creating an animated GIF on iOS, with no 3rd-party code required. This should also be easy to port to OS X.
View makeAnimatedGif.m
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
static UIImage *frameImage(CGSize size, CGFloat radians) {
UIGraphicsBeginImageContextWithOptions(size, YES, 1); {
[[UIColor whiteColor] setFill];
CGContextRef gc = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(gc, size.width / 2, size.height / 2);
skyfe79 / build.gradle
Created Jun 8, 2016 — forked from Takhion/build.gradle
Automatic Java home (7/8) for Retrolambda with Gradle
View build.gradle
String getJavaHome(String version)
def stdout = new ByteArrayOutputStream()
exec {
commandLine "/usr/libexec/java_home", "-v", version
standardOutput = stdout;
return stdout.toString().trim()
skyfe79 / GameViewController.swift
Created Feb 27, 2016 — forked from kconner/GameViewController.swift
Xcode 6.3 OpenGL Game template ported to Swift. (Add "-D DEBUG" to Other Swift Flags setting)
View GameViewController.swift
import GLKit
// Uniform index.
private enum Uniform {
case ModelViewProjectionMatrix, NormalMatrix
private var gUniforms: [Uniform: GLint] = [:]
extension GLKMatrix3 {
var array: [Float] {
skyfe79 / BST.swift
Created Feb 19, 2016
Functional BinarySearchTree in Swift
View BST.swift
import Cocoa
indirect enum BST<T: Comparable> {
case Leaf
case Node(BST<T>, T, BST<T>)
var bst = BST.Node(.Leaf, 10, .Leaf)
extension BST {
View gist:9cfbb94782b51d33a98c


Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

import java.nio.ByteBuffer;
public class AvcEncoder {
You can’t perform that action at this time.