Skip to content

Instantly share code, notes, and snippets.

View andymatuschak's full-sized avatar

Andy Matuschak andymatuschak

View GitHub Profile
//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// andy@andymatuschak.org
// Public domain because I love you. Let me know how you use it.
//
#import <Cocoa/Cocoa.h>
//
// PXImageBackground.h
// Pixen-XCode
//
// Copyright (c) 2003,2004,2005 Open Sword Group
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use,copy, modify, merge, publish, distribute, sublicense, and/or sell
//
// PXImageBackground.h
// Pixen-XCode
//
// Copyright (c) 2003,2004,2005 Open Sword Group
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use,copy, modify, merge, publish, distribute, sublicense, and/or sell
int *foo()
{
int x = 4;
return &x;
}
void tester()
{
int *x = foo();
*x = 8; // NOT OKAY
class Test
{
int s;
void foo()
{
int foo, bar;
bar.baz[4] = 4;
}
}
Salad of braised leek, persimmon, prosciutto, pine nuts, and parmesan, with a sherry vinaigrette
Spiced sous vide duck breast, roasted butternut squash, orange confit, sauteed oyster mushrooms
Marinated idiazábal, olives, roasted almonds
Gingerbread cookie + caramel ice cream sandwiches, poached pears with vanilla compote
type Call = Call { funcName :: String,
funcParams :: [Integer] }
parser :: Parser Call
parser = do
name <- ident
params <- commaSep integer
return (Call name params)
#
# uncrustify config file for objective-c and objective-c++
#
indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs
output_tab_size = 4 # new tab size
indent_columns = output_tab_size
indent_label = 2 # pos: absolute col, neg: relative column
indent_align_assign = FALSE
# What's wrong with List's "insert" method if called from multiple threads?
# How would you fix it?
class Node:
def __init__(self, value):
self.value = value
self.next = None
class List:
def __init__(self):
module Main where
import qualified Data.Set as Set
import qualified Data.Heap as Heap
import qualified Data.IntMap as IntMap
import Data.List
import Control.Monad
import Maybe
import System.Environment (getArgs)
import System.Process