Skip to content

Instantly share code, notes, and snippets.

View jcromartie's full-sized avatar

John Cromartie jcromartie

View GitHub Profile
@jcromartie
jcromartie / daily-report.sh
Created November 13, 2009 02:34
daily-report.sh
SUFFIX=`date "+%Y%m%d"`
OUTFILE=~/Desktop/"daily-report-$SUFFIX.txt"
(git log -U0 'HEAD@{12 hours ago}..' -- Classes/ | grep -Ev '^(\+\+\+|\-\-\-|diff|@@|index)') > $OUTFILE
int lmoaux_pushObjCRetValue(lua_State *L, NSInvocation *invocation) {
void *ret;
const char *pRetCode = [[invocation methodSignature] methodReturnType];
switch (*pRetCode) {
case '@':
ret = malloc(sizeof(id)); [invocation getReturnValue:ret]; lua_pushlightuserdata(L, (id)*ret);
break;
case 'f':
ret = malloc(sizeof(float)); [invocation getReturnValue:ret]; lua_pushnumber(L, (float)*ret);
- (void)forwardInvocation:(NSInvocation *)anInvocation {
lua_State *L = vm.L;
lua_rawgeti(L, LUA_REGISTRYINDEX, mappingRef);
const char *selStr = [NSStringFromSelector([anInvocation selector]) UTF8String];
// NSLog(@"trying to invoke %s", selStr);
lua_getfield(L, -1, selStr);
if (!lua_isfunction(L, -1)) {
NSLog(@"forwarding %s to %@", selStr, obj);
[anInvocation invokeWithTarget:obj];
#ifndef LOLCODE
#define LOLCODE
#include "stdio.h"
#define NUMBER int
#define HAI int main() {
#define LATERZ exit;
#define KTHXBYE return 0; }
#define UMM if (
using System;
class Foo {
}
class Bar : Foo {
}
class Program {
static void Greet(Foo f) {
- (NSString *)stringByActuallyAddingURLEncoding {
return [(NSString *)CFURLCreateStringByAddingPercentEscapes(
NULL,
(CFStringRef)self,
NULL,
(CFStringRef)@"!*\"'();:@&=+$,/?%#[]",
kCFStringEncodingUTF8) autorelease];
}
user=> (macroexpand '(doseq [x [1 2 3]] (println x)))
(loop* [seq_4 (clojure.core/seq [1 2 3]) chunk_5 nil count_6 (clojure.core/int 0) i_7 (clojure.core/int 0)] (if (clojure.core
/< i_7 count_6) (clojure.core/let [x (.nth chunk_5 i_7)] (do (println x)) (recur seq_4 chunk_5 count_6 (clojure.core/unchecke
d-inc i_7))) (clojure.core/when-let [seq_4 (clojure.core/seq seq_4)] (if (clojure.core/chunked-seq? seq_4) (clojure.core/let
[c__5257__auto__ (clojure.core/chunk-first seq_4)] (recur (clojure.core/chunk-rest seq_4) c__5257__auto__ (clojure.core/int (
clojure.core/count c__5257__auto__)) (clojure.core/int 0))) (clojure.core/let [x (clojure.core/first seq_4)] (do (println x))
(recur (clojure.core/next seq_4) nil (clojure.core/int 0) (clojure.core/int 0)))))))
NSArray *toolbarItems = [NSArray arrayWithObjects:
[[[UIBarButtonItem alloc] initWithTitle:@"Foo" style:UIBarButtonItemStyleBordered target:self action:@selector(foo)] autorelease],
nil];
[self.navigationController setToolbarItems:toolbarItems];
var win = Titanium.UI.createWindow({url: 'login.html'});
// this should just work:
win.someProperty = myObject;
win.open({animated:true});
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.expensebooks.android"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name" >
<activity android:name=".ExpenseBooks"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.VIEW" />