Skip to content

Instantly share code, notes, and snippets.

View kirb's full-sized avatar
🔥

Adam Demasi kirb

🔥
View GitHub Profile
#!/bin/sh
PLIST_BUDDY=/usr/libexec/PlistBuddy
function add_compatibility() {
"$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \
"$1/Contents/Info.plist"
}
function has_compatibility() {
@kirb
kirb / gist:4148344
Created November 26, 2012 14:00 — forked from S1ReX/gist:4148340
CGRect alertFrame = self.frame;
CGFloat oldY = alertFrame.origin.y;
alertFrame.origin.y = -alertFrame.size.height;
self.frame = alertFrame;
[UIView animateWithDuration:.3f animations:^{
CGRect alertFrame = self.frame;
alertFrame.origin.y = oldY;
self.frame = alertFrame;
}];
@kirb
kirb / index.php
Created May 9, 2012 14:20 — forked from rpetrich/index.php
Twitter self-hosted image service/url shortener
<?
// Twitter self-hosted image service/url shortener by Ryan Petrich
// Installation:
// 1. Paste this script into the top of your HTTP root's index.php (rename index.html to index.php if it doesn't exist)
// 2. Add the following to your HTTP root's .htaccess file (create .htaccess if it doesn't exist):
// ErrorDocument 404 /index.php
// 3. Create a "s" subfolder and give it 777 permissions
// 4. Add the following as the custom URL for URL shortening in Twitter for iPhone's settings:
// http://yourdomain.com/?d=%@&p=password
// 5. Add the following as the custom URL for Image service:
@kirb
kirb / change-favicon.js
Created October 3, 2011 05:12 — forked from mathiasbynens/change-favicon.js
Dynamically changing favicons with JavaScript
/*!
* Dynamically changing favicons with JavaScript
* Works in all A-grade browsers except Safari and Internet Explorer
* Demo: http://mathiasbynens.be/demo/dynamic-favicons
*/
// HTML5™, baby! http://mathiasbynens.be/notes/document-head
document.head=typeof document.head!="object"?document.getElementsByTagName("head")[0]:document.head;
function changeFavicon(src) {