Skip to content

Instantly share code, notes, and snippets.

View fannheyward's full-sized avatar
🎯
Slow to response

Heyward Fann fannheyward

🎯
Slow to response
View GitHub Profile
@fannheyward
fannheyward / gist:1113426
Created July 29, 2011 08:08
Show/hide keyboard
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.35];
if (self.isFlipped) {
[self.textView resignFirstResponder];
self.keyboard.transform = CGAffineTransformMakeRotation(0);
self.showHideButton.transform = CGAffineTransformMakeRotation(0);
} else {
[self.textView becomeFirstResponder];
self.keyboard.transform = CGAffineTransformMakeRotation(M_PI);
@fannheyward
fannheyward / longURL.scpt for Quicksilver
Created May 10, 2011 03:15
longURl action for Quicksilver, powered by http://longurl.org
using terms from application "Quicksilver"
on process text _text
try
set the _encodedUrl to _urlEncode(_text) of me
set curlCMD to "curl --stderr /dev/null \"http://api.longurl.org/v2/expand?url=" & _encodedUrl & "\""
tell me to set _longURL to (do shell script curlCMD)
set AppleScript's text item delimiters to "CDATA["
@fannheyward
fannheyward / statusline of vim
Created April 9, 2011 09:16
statusline for vim, via newsmth.
set laststatus=2 " always show the status line
let statusHead ="%-.50f\ %h%m%r"
let statusBreakPoint ="%<"
let statusSeparator ="|"
let statusFileType ="%{((&ft\ ==\ \"help\"\ \|\|\ &ft\ ==\ \"\")?\"\":\"[\".&ft.\"]\")}"
let statusFileFormat ="[%{(&ff\ ==\ \"unix\")?\"u\":\"d\"}]"
let statusAscii ="\{%b:0x%B\}"
let statusCwd ="%-.50{getcwd()}"
let statusBody =statusFileType.statusFileFormat.statusSeparator.statusAscii.statusSeparator."\ ".statusBreakPoint.statusCwd
let statusEncoding ="[%{(&fenc\ ==\ \"\"?&enc:&fenc).(&bomb?\",BOM\":\"\")}]"