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 / picky2octopress.rb
Created November 30, 2011 07:51
Import XML of Picky to Octopress
# -*- coding: utf-8 -*-
require 'fileutils'
require 'date'
require 'yaml'
require 'uri'
require 'rexml/document'
include REXML
doc = Document.new File.new(ARGV[0])
@fannheyward
fannheyward / TWRequest+OAuthEcho.h
Created March 21, 2012 08:15
Add OAuth Echo methods to TWRequest
#import <Twitter/Twitter.h>
#import <Accounts/Accounts.h>
@interface TWRequest (OAuthEcho)
/*
* code example:
*
* NSURL *url = [NSURL URLWithString:@"https://api.twitter.com/1/account/verify_credentials.json"];
@fannheyward
fannheyward / build_universal_library.sh
Last active October 12, 2015 17:47 — forked from adamgit/gist:3705459
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.7
#
# Latest Change:
# - Supports iPhone 5 / iPod Touch 5 (uses Apple's workaround to lipo bug)
#
# Purpose:
@fannheyward
fannheyward / build.py
Created November 28, 2012 06:24 — forked from rjyo/build.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import shutil
import json
import getopt
import urllib2
from urllib import urlencode
@fannheyward
fannheyward / build.py
Created November 28, 2012 06:24 — forked from rjyo/build.py
OTA
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import shutil
import json
import getopt
import urllib2
from urllib import urlencode
APP = Pages
WORKSPACE = Pages
CONFIG = InHouse
SCHEME = PagesInHouse
ICON_NAME = Icon@2x.png
BASE_URL = http://beta.nsnotfound.com/pages
EMAIL_LIST = newproject@lexrus.mailgun.org
EMAIL_DOMAIN = lexrus.mailgun.org
SFTP_SERVER = lex@nsnotfound.com
/**
* Loading Indicator
*
* @author Maikel Daloo
* @date 12th March 2013
*
* Creates a new module and intercepts all ajax requests.
* Every time a request is sent, we display the loading message and increment
* the enable_counter variable. Then when requests complete (whether success or error)
* we increment the disable_counter variable and we only hide the loading message
angular
.module('loadingOnAJAX', [])
.config(function($httpProvider) {
var numLoadings = 0;
var loadingScreen = $('<div style="position:fixed;top:0;left:0;right:0;bottom:0;z-index:10000;background-color:gray;background-color:rgba(70,70,70,0.2);"><img style="position:absolute;top:50%;left:50%;" alt="" src="data:image/gif;base64,R0lGODlhQgBCAPMAAP///wAAAExMTHp6etzc3KCgoPj4+BwcHMLCwgAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAQgBCAAAE/xDISau9VBzMu/8VcRTWsVXFYYBsS4knZZYH4d6gYdpyLMErnBAwGFg0pF5lcBBYCMEhR3dAoJqVWWZUMRB4Uk5KEAUAlRMqGOCFhjsGjbFnnWgliLukXX5b8jUUTEkSWBNMc3tffVIEA4xyFAgCdRiTlWxfFl6MH0xkITthfF1fayxxTaeDo5oUbW44qaBpCJ0tBrmvprc5GgKnfqWLb7O9xQQIscUamMJpxC4pBYxezxi6w8ESKU3O1y5eyts/Gqrg4cnKx3jmj+gebevsaQXN8HDJyy3J9OCc+AKycCVQWLZfAwqQK5hPXR17v5oMWMhQEYKLFwmaQTDgl5OKHP8cQjlGQCHIKftOqlzJsqVLPwJiNokZ86UkjDg5emxyIJHNnDhtCh1KtGjFkt9WAgxZoGNMny0RFMC4DyJNASZtips6VZkEp1P9qZQ3VZFROGLPfiiZ1mDKHBApwisZFtWkmNSUIlXITifWtv+kTl0IcUBSlgY
@fannheyward
fannheyward / popAnimation
Created August 15, 2013 01:13
popAnimation like UIAlertView. via http://xcodev.com/761.html
CAKeyframeAnimation *popAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
popAnimation.duration = 0.4;
popAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.01f, 0.01f, 1.0f)],
[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.1f, 1.1f, 1.0f)],
[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.9f, 0.9f, 1.0f)],
[NSValue valueWithCATransform3D:CATransform3DIdentity]];
popAnimation.keyTimes = @[@0.0f, @0.5f, @0.75f, @1.0f];
popAnimation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut],
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut],
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
myApp.directive('markdown', function () {
var converter = new Showdown.converter();
return {
restrict: 'AE',
link: function (scope, element, attrs) {
if (attrs.markdown) {
scope.$watch(attrs.markdown, function (newVal) {
var html = converter.makeHtml(newVal);
element.html(html);
});