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
@orklann
orklann / gist:9885367
Created March 31, 2014 04:32
TM2 variables
env|sort
Apple_PubSub_Socket_Render=/tmp/launch-NGKxkr/Render
COMMAND_MODE=unix2003
HOME=/Users/mac
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LOGNAME=mac
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/Users/mac/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/bin
PWD=/Users/mac
SHELL=/bin/bash

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
}
@orklann
orklann / -webkit-font-smoothing
Last active September 9, 2016 14:29
-webkit-font-smoothing: antialiased; implementation (inspired from WebKit source code)
// -webkit-font-smoothing: antialiased; may needs the following lines
CGContextRef context = [[NSGraphicsContext currentContext] CGContext];
CGContextSetAllowsAntialiasing(context, true);
CGContextSetShouldAntialias(context, true);
// -webkit-font-smoothing: antialiased; == the following line
// Edit #1: This tell macOS to render text in grayscale mode if set to false (-webkit-font-smoothing: antialiased;)
// Tell macOS to render text in subpixel anti-aliasing if set to true (-webkit-font-smoothing: subpixel-antialiased;)
CGContextSetShouldSmoothFonts(context, false);
// end of -webkit-font-smoothing: antialiased;
@orklann
orklann / gist:ddf7a45ac1e9f315ddea
Created July 5, 2015 09:15
Goagent + Safari = Twitter 不能打开解决办法
把 goagent 的 ca 证书拖到 System 既可以,默认是导入到 Login。
@orklann
orklann / gist:e1b190e5d0bd93604fb1
Created August 9, 2015 14:05
韩剧《制作人》居然有黑塞小说《德米安》
韩剧《制作人》居然有黑塞小说《德米安》,一下子想起书中的句子:“每个人的真正职责只有一个:
找到自我。然后在心中坚守一生,全心全意,永不停息。所有其它的路都是不完整的,是人的逃避方式,
是对社会角色的懦弱伪装,是随波逐流,是对内心的恐惧”
- 阮一峰 (Twitter)
@orklann
orklann / snowden-ietf93.md
Last active August 29, 2015 14:27 — forked from mnot/snowden-ietf93.md
Transcript of Edward Snowden's comments at IETF93.
@orklann
orklann / gist:8e192923d00004d079e9
Created October 16, 2015 14:58
Ubuntu Qemu error
/home/aaron/tmp/qemu/migration/rdma.c: In function ‘rdma_add_block’:
/home/aaron/tmp/qemu/migration/rdma.c:580:45: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
g_hash_table_insert(rdma->blockmap, (void *) block_offset, block);
^
cc1: all warnings being treated as errors
make: *** [migration/rdma.o] Error 1
@orklann
orklann / gist:dfc05e68caf37372d6dc
Last active June 12, 2018 06:46
Draw NSImage onto another NSImage (Better)
@interface NSImage (NSBitmapImageRep)
- (NSBitmapImageRep *)bitmapImageRepresentation;
@end
@implementation NSImage (NSBitmapImageRep)
- (NSBitmapImageRep *)bitmapImageRepresentation
{
int width = [self size].width;
int height = [self size].height;
@orklann
orklann / gist:271bc15f7438c6d847a27de9aa5a5d88
Last active October 6, 2016 08:01
How to fix touchpad event not detected in Vill Q
In CGMaskWindow.m, change
- (void)setView:(NSView *)view {
NSRect windowBounds = [self frame];
windowBounds.origin = NSMakePoint(0, 0);
[view setFrame:windowBounds];
self.topMostView = view;