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
Edward Snowden answered questioned after a showing of CITIZENFOUR at the IETF93 meeting; this is a transcript of the video recording.
For more information, see the Internet Society article.
"JUST BECAUSE YOU'RE USING SWIFT DOESN'T MEAN YOUR QUESTION IS ABOUT SWIFT"
Ask your question and then be patient. Tell us what you want to happen, what is actually happening, and include any error messages you find:
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() |
#!/usr/bin/env python | |
""" | |
Example on using Kqueue/Kevent on BSD/Mac | |
using Python. | |
The TCP server essentially echoes back the | |
message it receives on the client socket. | |
""" | |
__author__ = "Ishwor Gurung <[email protected]>" |
package main | |
import ( | |
"fmt" | |
"net" | |
"time" | |
"bufio" | |
) | |
func handleConnection(conn net.Conn) { |
今天发现 GitHub 有两步验证的功能,于是打算开启,可是悲剧的是,到了填写手机号的时候,发现没有 China 的选项。 | |
于是我尝试了下修改网页源代码,添加了 `<option value="+86">China +86</option>` 再填手机号,居然就收到短信了。 | |
后来有点不放心,还是给 https://github.com/contact 发了个反馈,然后收到回信说由于某些国家的短信发送成功率无法保证,所以没有开启两步验证功能。 | |
不过在我这段时间的使用过程中,还是挺稳定的,每次都能收到短信。 | |
大家如果也需要开启两步验证,最好把 Recover code 也记下来吧,避免以后短信收不到。 |
library nodejs; | |
import "dart:js"; | |
/** | |
* Simple Helper Class | |
*/ | |
class Console { | |
void log(String message) => context['console'].callMethod("log", [message]); |
#!/usr/bin/python2.6 | |
# -*- coding: utf-8 -*- | |
import objc | |
from Foundation import * | |
from AppKit import * | |
from PyObjCTools import AppHelper | |
NSWindowDelegate = objc.protocolNamed("NSWindowDelegate") |
# Do not excute the script directly. It is just for demonstration. | |
# If you followed the documentation and got the errors below, please take a look at this guide. | |
# Color management: using fallback mode for management | |
# bpy: couldnt find 'scripts/modules', blender probably wont start. | |
# Freestyle: couldn't find 'scripts/freestyle/modules', Freestyle won't work properly. | |
# ImportError: No module named 'bpy_types' | |
# ImportError: No module named 'bpy_types' | |
# pyrna_srna_ExternalType: failed to find 'bpy_types' module | |
# ImportError: No module named 'bpy_types' |