Skip to content

Instantly share code, notes, and snippets.

View orklann's full-sized avatar
🏠
Working from home

rkt orklann

🏠
Working from home
View GitHub Profile

Set the Mac OS X SOCKS proxy on the command line

a.k.a. what to do when your ISP starts blocking sites :(

Set the SOCKS proxy to local SSH tunnel

networksetup -setsocksfirewallproxy "Ethernet" localhost 8080

To clear the domain and port

@orklann
orklann / sublime-settings
Last active August 29, 2015 14:21
Sublime Text 3 User settings
{
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"font_face": "consolas",
"font_size": 13,
"tab_size": 4,
"translate_tabs_to_spaces": true,
"use_tab_stops": true,
"rulers":[80],
"draw_indent_guides": false
}
@cook
cook / draw-arrow-with-pattern.mm
Last active December 13, 2015 19:59
在Quartz 2D中使用pattern。
void drawStripes(void *info, CGContextRef con)
{
// assume 4x4 cell
CGContextSetFillColorWithColor(con, [[UIColor redColor] CGColor]);
CGContextFillRect(con, CGRectMake(0, 2, 4, 2));
CGContextSetFillColorWithColor(con, [[UIColor blueColor] CGColor]);
CGContextFillRect(con, CGRectMake(0, 0, 4, 2));
}
@orklann
orklann / albums.md
Last active July 4, 2017 09:02
Music Albums
  • Billie Holiday
  • Green Day - 21st.Century Breakdown
  • Allen Toussaint
  • Dido - No Angel
  • Dido - Girl Who Got Away (2013)
  • Clavin Harris - Motion
@azenla
azenla / node.dart
Last active July 6, 2017 08:55
Node.js Interop
library nodejs;
import "dart:js";
/**
* Simple Helper Class
*/
class Console {
void log(String message) => context['console'].callMethod("log", [message]);
@orklann
orklann / nwn2.md
Last active July 24, 2017 13:03
Neverwinter Nights 2 FPS improvement
@orklann
orklann / 1pixel-wegbl.txt
Last active August 4, 2017 05:23
Draw 1 pixel with Webgl
canvas.width = canvas.height = 400;
left-top is the origin in pixels
|---|---|
| | |
|---o---|
| | |
|---|---|
`o` is the origin in Webgl viewport
@orklann
orklann / ignore-discord-web.md
Created November 1, 2017 12:37
忽略 Discord 网页版的服务器
discordapp.com, gateway.discord.gg
@orklann
orklann / pixelegg.me.domain.md
Created November 15, 2017 00:53
pixelegg.me can not be opened after renew domain

After renew pixelegg.me, it can not be opened.

Solution:

Go to godaddy.com and change the A record for @

A @ 45.32.225.253 600 seconds

@finder39
finder39 / Swift-MD5.swift
Last active March 20, 2018 13:37
Swift MD5
extension String {
func md5() -> String! {
let str = self.cStringUsingEncoding(NSUTF8StringEncoding)
let strLen = CUnsignedInt(self.lengthOfBytesUsingEncoding(NSUTF8StringEncoding))
let digestLen = Int(CC_MD5_DIGEST_LENGTH)
let result = UnsafeMutablePointer<CUnsignedChar>.alloc(digestLen)
CC_MD5(str!, strLen, result)
var hash = NSMutableString()