Skip to content

Instantly share code, notes, and snippets.

View Fykec's full-sized avatar

yinjiaji Fykec

View GitHub Profile
@Fykec
Fykec / USING-DIFFMERGE.md
Last active November 11, 2021 07:20 — forked from smoll/USING-DIFFMERGE.md
Using DiffMerge as your git mergetool (for Mac OS X / macOS)
@Fykec
Fykec / sslocal.service
Created May 16, 2017 07:15 — forked from ygmpkk/sslocal.service
ShadowSocks Client Systemd Service
[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]
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
@Fykec
Fykec / objc.cfg
Last active August 29, 2015 13:57 — forked from tszming/objc.cfg
#
# 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
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
@Fykec
Fykec / gist:8035507
Created December 19, 2013 07:13 — forked from carlj/gist:3782351
+ (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 ] ];
@Fykec
Fykec / topTen.sh
Last active December 29, 2015 07:39 — forked from jamescarr/gist:5843247
Top 10 shell commands you currently use
LC_ALL='C' history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
@Fykec
Fykec / symbolicate_crash.sh
Last active December 24, 2015 03:39 — forked from xperienced/symbolicate_crash.sh
Update symbolicatecrash dir for XCode 5
#!/bin/sh
export DEVELOPER_DIR="/Applications/XCode.app/Contents/Developer"
SYMBOLICATECRASH=`find /Applications/Xcode.app -name symbolicatecrash -type f`
${SYMBOLICATECRASH} -v "$1"
@Fykec
Fykec / gist:5028782
Created February 25, 2013 09:44 — forked from pokeb/gist:150447
//
// 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;
;; 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