Skip to content

Instantly share code, notes, and snippets.

View jhaynie's full-sized avatar
πŸ€–
making agents and stuff

Jeff Haynie jhaynie

πŸ€–
making agents and stuff
View GitHub Profile
var oldThis = this;
// If the Ti object were definied in JS like this...
var Ti = {
UI: {
createView: function(args) {
return new Ti.UI.View(args);
},
View: function(args) {
if (!(this instanceof arguments.callee)) {
@kaspermunck
kaspermunck / build_and_run_unit_tests.sh
Created April 12, 2013 21:30
A slightly modified XcodeTest build script that works for projects with Kiwi installed via CocoaPods (that use workspaces).
#!/bin/bash
# Script to compile and run unit tests from the command line
# The scheme and target name of the main app
MAIN_APP_TARGET="$1"
# The scheme and target name of the unit tests
UNIT_TEST_TARGET="$2"
# The path to libXcodeTest.a, if not in current directory
@tonylukasavage
tonylukasavage / .bash_profile
Last active December 18, 2015 08:49
Shell script to create a new Titanium project, make it Alloy, and load it up in Sublime Text
# Here's how to add it to a shell profile
tialloy() {
ti create --id com.testing.$1 --name $1 --workspace-dir . --platforms \
android,blackberry,ios,ipad,iphone,mobileweb,tizen --no-prompt && \
cd $1 && alloy new . && subl .
}
@markd2
markd2 / runtime.m
Created July 9, 2013 20:55
Objective-C runtime metadata dumper.
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
#import "typestring.h"
// clang -g -fobjc-arc -Wall -framework Foundation -o runtime typestring.m runtime.m
// Runtime reference, at least until Apple breaks the link
// http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html
@tbrianjones
tbrianjones / free_email_provider_domains.txt
Last active July 16, 2025 09:55
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@jmoiron
jmoiron / valuer.go
Created October 14, 2013 18:03
Example uses of sql.Scanner and driver.Valuer
package main
import (
"bytes"
"compress/gzip"
"database/sql/driver"
"errors"
"fmt"
"github.com/jmoiron/sqlx"
_ "github.com/mattn/go-sqlite3"
@yuchi
yuchi / result.js
Created October 15, 2013 08:05
using CoffeeScript with Appcelerator Hyperloop
@import('Foundation/NSDictionary');
@import('Foundation/NSMutableDictionary');
@import('Foundation/NSNumber');
@import('Foundation/NSBundle');
@import('Foundation/NSString');
@import('Foundation/NSUTF8StringEncoding');
@import('Foundation/NSObject');
@import('Foundation/UILabel');
@import("Foundation/NSLog");
;
@rxaviers
rxaviers / gist:7360908
Last active July 19, 2025 15:26
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@mikeash
mikeash / runtime-class.m
Created November 22, 2013 16:46
Creating a usable class purely at runtime using the Objective-C runtime APIs.
// clang -fobjc-arc -framework Foundation runtime-class.m
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
@interface Person : NSObject
- (id)initWithFirstName: (NSString *)firstName lastName: (NSString *)lastName age: (NSUInteger)age;
@simonwhitaker
simonwhitaker / swmath.m
Last active January 1, 2016 22:58
Architecture-independent floor() function
/*
* Calling math.h functions like `floor` and `floorf` on CGFloat variables
* becomes problematic when compiling the same code for both 32-bit and
* 64-bit platforms, since CGFloat is double on 64-bit, float on 32-bit.
* Hence, if you compile with -Wconversion set, `floorf` will give a warning
* on 64-bit, while `floor` gives a warning on 32-bit.
*
* Here's a suggested implementation of an architecture-independent `floor`
* function, written using plain old function overloading which is enabled
* using the `__attribute__((overloadable))` Clang language extension.