Reference(s):
This file contains hidden or 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
[Unit] | |
Description=Daemon to start Shadowsocks Client | |
Wants=network-online.target | |
After=network.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/sslocal -c /etc/shadowsocks/client.json --pid-file /var/run/sslocal.pid --log-file /var/log/sslocal.log | |
[Install] |
This file contains hidden or 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
function wopen { # via https://gist.github.com/coryalder/5609996 | |
WORKSPACE="${PWD##*/}.xcworkspace" | |
PROJECT="${PWD##*/}.xcodeproj" | |
if [ -a $WORKSPACE ]; then | |
open $WORKSPACE; | |
elif [ -a $PROJECT ]; then | |
open $PROJECT; | |
else | |
echo "No workspace or project found."; | |
fi |
This file contains hidden or 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
# | |
# uncrustify config file for objective-c and objective-c++ | |
# | |
indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs | |
output_tab_size = 4 # new tab size | |
indent_columns = output_tab_size | |
indent_label = 2 # pos: absolute col, neg: relative column | |
indent_align_assign = FALSE | |
This file contains hidden or 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
Call removeTarget:action:forControlEvents: pass nil for the target, NULL for action, and use a control mask that sets all bits (UIControlEventAllEvents). Something like this: | |
[someControl removeTarget:nil | |
action:NULL | |
forControlEvents:UIControlEventAllEvents]; | |
https://developer.apple.com/library/ios/#documentation/uikit/reference/UIControl_Class/Reference/Reference.html | |
http://stackoverflow.com/questions/3340825/uibutton-remove-all-target-actions |
This file contains hidden or 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
+ (UIImage*)imageNamedForDevice:(NSString*)name { | |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) | |
{ | |
if (([UIScreen mainScreen].bounds.size.height * [UIScreen mainScreen].scale) >= 1136.0f) | |
{ | |
//Check if is there a path extension or not | |
if (name.pathExtension.length) { | |
name = [name stringByReplacingOccurrencesOfString: [NSString stringWithFormat:@".%@", name.pathExtension] | |
withString: [NSString stringWithFormat:@"-568h@2x.%@", name.pathExtension ] ]; |
This file contains hidden or 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
LC_ALL='C' history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head |
This file contains hidden or 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
#!/bin/sh | |
export DEVELOPER_DIR="/Applications/XCode.app/Contents/Developer" | |
SYMBOLICATECRASH=`find /Applications/Xcode.app -name symbolicatecrash -type f` | |
${SYMBOLICATECRASH} -v "$1" |
This file contains hidden or 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
// | |
// MyController.h | |
// | |
// Created by Ben Copsey on 20/07/2009. | |
// Copyright 2009 All-Seeing Interactive. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <GHUnit/GHUnit.h> | |
@class ASINetworkQueue; |
This file contains hidden or 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
;; auto-complete-mode | |
(setq ac-modes (append ac-modes '(objc-mode))) | |
(add-to-list 'load-path (expand-file-name "~/.emacs.d/vendor")) ;; Set your own Path to auto-complete-clang.el | |
(setq ac-clang-flags (list "-D__IPHONE_OS_VERSION_MIN_REQUIRED=30200" "-x" "objective-c" "-std=gnu99" "-isysroot" xcode:sdk "-I." "-F.." "-fblocks")) | |
(require 'auto-complete-clang) | |
;; (setq ac-clang-prefix-header "stdafx.pch") | |
;; (setq ac-clang-flags '("-w" "-ferror-limit" "1")) | |
;(setq clang-completion-flags (list "-Wall" "-Wextra" "-fsyntax-only" "-ObjC" "-std=c99" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk" "-I." "-F.." "-D__IPHONE_OS_VERSION_MIN_REQUIRED=30200")) | |
(add-hook 'objc-mode-hook | |
(lambda () (setq ac-sources (append '(ac-source-clang |
NewerOlder