Skip to content

Instantly share code, notes, and snippets.

@sansumbrella
sansumbrella / simpleserver.sh
Created November 26, 2012 22:31
Python simple server
python -m SimpleHTTPServer 8080
@sansumbrella
sansumbrella / remove_if.cpp
Created November 26, 2012 15:21 — forked from cporter/remove_if.cpp
remove_if and vector
// -*- compile-command: "clang++ -std=gnu++0x -stdlib=libc++ -o remove_if remove_if.cpp" -*-
#include <iostream>
#include <vector>
using std::cout;
using std::endl;
int main (int, char **) {
std::vector<int> ints = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
cout << "Range-based for loop:" << endl;
@sansumbrella
sansumbrella / user-config.jam
Created November 12, 2012 04:43
Boost config for building with Clang and libc++ support
# --------------------
# Clang configuration.
# --------------------
using clang : osx
: xcrun clang -arch i386 -arch x86_64 -stdlib=libc++ -std=c++11
;
using clang : ios
: xcrun clang -arch armv7 -arch armv7s -stdlib=libc++ -std=c++11 -miphoneos-version-min=5.0 -isysroot
@sansumbrella
sansumbrella / ESTwoApp.cpp
Created August 15, 2012 19:44
Cinder ES2 Sample
#include "cinder/app/AppCocoaTouch.h"
#include "cinder/Camera.h"
#include "cinder/gl/GlslProg.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class ESTwoApp : public AppCocoaTouch {
public:
@sansumbrella
sansumbrella / ti-intervalometer.vb
Created May 30, 2012 06:40
Code for TI-83+ so the calculator acts as an intervalometer
/*
TI-83+ code to use calculator as an intervalometer
Adapted from a comment on:
http://www.instructables.com/id/Turn-a-TI-Graphing-Calculator-into-an-Intervalomet/
*/
Disp "START IN "
Disp "SECONDS"
Prompt A
A*238 -> S
@sansumbrella
sansumbrella / gist:1674553
Created January 25, 2012 03:30
Basic HTML File
<!DOCTYPE html>
<head>
<meta charset="utf-8"/>
<title>now</title>
</head>
<body>
<h1>This page is titled now.</h1>
<p>This is some content in a paragraph.</p>
@sansumbrella
sansumbrella / gauss.pde
Created November 17, 2011 00:32
Find the gaussian value of a position
// loc = distance from center of distribution
float gaussian( float loc, float variance )
{
variance *= variance;
float a = loc * loc / ( 2.0 * variance );
float b = exp( -a );
float c = sqrt( PI * 2.0 * variance );
return b / c;
}
@sansumbrella
sansumbrella / shutdown.scpt
Created August 23, 2011 00:07
Shut down your computer immediately without sudo
tell application "System Events" to shut down
@sansumbrella
sansumbrella / com.sansumbrella.launchscript.plist
Created June 19, 2011 01:00
Sample launchctl plist. Put in ~/Library/LaunchAgents/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.sansumbrella.scriptlauncher</string>
<key>Program</key>
<string>/usr/bin/python</string>
<key>ProgramArguments</key>
<array>
@sansumbrella
sansumbrella / gitconfig
Created June 16, 2011 00:06
Some git config settings
[user]
name = David Wicks
email = youcanprobablyfindit@sansumbrella.com
[color]
branch = auto
status = auto
diff = auto
[alias]
st = status -sb
co = checkout