Skip to content

Instantly share code, notes, and snippets.

View saiday's full-sized avatar
:shipit:
su su su

Saiday saiday

:shipit:
su su su
View GitHub Profile
@kconragan
kconragan / keyrepeat.shell
Last active December 4, 2023 03:40
Enable key repeat in Apple Lion for Sublime Text in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@ykarikos
ykarikos / png2svg.sh
Created June 7, 2012 22:17
Convert png to svg using imagemagick and potrace
#!/bin/bash
if [ "$1" == "" ]; then
echo Usage: $0 pngfile
exit 0;
fi
FILE=`basename $1 .png`
if [ ! -e $FILE.png ]; then
@angelolloqui
angelolloqui / UIImage+H568.m
Last active October 6, 2022 16:35
iPhone5 UIImage method swizzling to load -568h images
//
// UIImage+H568.m
//
// Created by Angel Garcia on 9/28/12.
// Copyright (c) 2012 angelolloqui.com. All rights reserved.
//
#import <objc/runtime.h>
@implementation UIImage (H568)
@ryanfitz
ryanfitz / golang-nuts.go
Created December 2, 2012 22:45
two ways to call a function every 2 seconds
package main
import (
"fmt"
"time"
)
// Suggestions from golang-nuts
// http://play.golang.org/p/Ctg3_AQisl
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@ponkore
ponkore / private.xml
Created February 27, 2013 15:00
Mac Book Pro の JIS キーボードを KeyRemap4MacBook 8.0.0 で英字配列にして使うとき、Backquote(`) と Tilde(~) がアサインされなくなってしまうので、¥記号を Backquote(`) に割り当てる(SHIFT+¥で Tilde(~) になる)。 ~/Library/Application Support/KeyRemap4MacBook/private.xml
<?xml version="1.0"?>
<root>
<appdef>
<appname>Modify Yen Mark Key</appname>
<equal>com.github.ponkore</equal>
</appdef>
<item>
<name>Modify Yen Mark Key</name>
<item>
@dixia
dixia / dump device tokens from Urbanairship
Created June 28, 2013 12:16
Dumping device tokens from Urbanairship. Pry is used.
require 'rubygems'
require 'httparty'
require 'pry'
results = []
def get_device_tokens url
if url.nil?
url = "https://go.urbanairship.com/api/device_tokens/"
end
options = {:basic_auth => {:username => 'x', :password => 'x'}}
@timdream
timdream / gist:5968469
Last active May 25, 2024 16:56
Github 發 Pull Request & 貢獻流程速查

Github 發 Pull Request & 貢獻流程速查

前言

此文目標讀者需先自行學會

  • 開 Github 帳號
  • 會 fork 程式 repository
  • 會在自己的電腦使用命令列 git
  • 會 clone 自己的 repository
import lldb
import re
import shlex
# This script allows Xcode to selectively ignore Obj-C exceptions
# based on any selector on the NSException instance
def getRegister(target):
if target.triple.startswith('x86_64'):
return "rdi"
@floriankugler
floriankugler / gist:6870499
Last active September 29, 2023 15:56
Mapping of NSURLConnection to NSURLSession delegate methods. Created by Mattt Thompson.
NSURLConnection | NSURLSession
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connectionShouldUseCredentialStorage: |
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler:
| N