apt-get install python-pip
pip install shadowsocks
sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Algorithm found here: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html | |
$filename = 'image.jpg'; | |
list($width, $height) = getimagesize($filename); | |
$img = imagecreatefromjpeg($filename); | |
$new_img = imagecreatetruecolor(8, 8); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var countries = { | |
ae: 'United Arab Emirates', | |
ag: 'Antigua and Barbuda', | |
ai: 'Anguilla', | |
al: 'Albania', | |
am: 'Armenia', | |
ao: 'Angola', | |
ar: 'Argentina', | |
at: 'Austria', | |
au: 'Australia', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIApplication { | |
private struct AssociatedObjectsKeys { | |
static var visibleViewControllersPointers = "UIApplication_visibleViewControllersPointers" | |
} | |
fileprivate var visibleViewControllersPointers: NSPointerArray { | |
var pointers = objc_getAssociatedObject(self, &AssociatedObjectsKeys.visibleViewControllersPointers) as! NSPointerArray? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fragment shader | |
// | |
// RGBA color to RGBA greyscale | |
// | |
// smooth transition based on u_colorFactor: 0.0 = original, 1.0 = greyscale | |
// | |
// http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/ | |
// "The luminosity method is a more sophisticated version of the average method. | |
// It also averages the values, but it forms a weighted average to account for human perception. | |
// We’re more sensitive to green than other colors, so green is weighted most heavily. The formula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std = "max" | |
files['.luacheckrc'].global = false | |
unused_args = false | |
globals = { | |
"sys", | |
"go", | |
"gui", | |
"label", | |
"render", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typealias UIAlertActionHandler = ((UIAlertAction) -> Swift.Void)? | |
private struct AssociatedKeys { | |
static var handler = "cc_handler" | |
} | |
private let swizzling: (UIAlertAction.Type) -> () = { action in | |
// in swift this looks like an init, but in obj-c it's really actionWithTitle:style:handler class method | |
let originalSelector = #selector(UIAlertAction.init(title:style:handler:)) | |
let swizzledSelector = #selector(UIAlertAction.action(testTitle:style:handler:)) // so swizzling an init won't work. we have to use another class method | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Switch xcrun to leverage Xcode 7 | |
# Note: This won't be needed once Xcode 7 is released | |
# and becomes the primary Xcode in use. | |
export DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer/ | |
# Export Archive | |
xcrun xcodebuild -exportArchive -exportOptionsPlist exportPlist.plist -archivePath /path/to/app.xcarchive -exportPath /path/to/app.ipa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== Adb Server | |
adb kill-server | |
adb start-server | |
== Adb Reboot | |
adb reboot | |
adb reboot recovery | |
adb reboot-bootloader | |
== Shell |
OlderNewer