Skip to content

Instantly share code, notes, and snippets.

View yickling's full-sized avatar
💭
I may be slow to respond.

Anthony Lam yickling

💭
I may be slow to respond.
View GitHub Profile
@yickling
yickling / keybase.md
Created June 29, 2022 09:05
keybase proof

Keybase proof

I hereby claim:

  • I am yickling on github.
  • I am yickling (https://keybase.io/yickling) on keybase.
  • I have a public key ASCCo3Axi1bfItqim1kOi8MY1ZaXHBukf_ikJwG0RI66Mgo

To claim this, I am signing this object:

// Exercise 1: Print all the names in an array
function(console) {
var names = ["Ben", "Jafar", "Matt", "Priya", "Brian"];
names.map(function(name) { console.log(name); });
}
@yickling
yickling / gist:ef20f7f1bd8341c2a46db05afe8b4e4d
Created June 7, 2017 13:49
Nginx rewrite path to point back to root
# This will rewrite 1.2.3.4/sub back to 1.2.3.4:3000
location /sub {
rewrite /sub(.*) $1 break;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://localhost:3000;
}
@yickling
yickling / placeholderImage.swift
Created December 21, 2016 09:31
Placeholder UIImage in Swift
func generatePlaceholderImageWithColor(_ color: UIColor) -> UIImage? {
let rect : CGRect = CGRect(x: 0, y: 0, width: 1, height: 1)
UIGraphicsBeginImageContextWithOptions(rect.size, false, 0)
color.setFill()
UIRectFill(rect)
let image : UIImage = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
return image
}