Skip to content

Instantly share code, notes, and snippets.

View christianchristensen's full-sized avatar

Chris Christensen christianchristensen

View GitHub Profile
@arvearve
arvearve / gist:4158578
Created November 28, 2012 02:01
Mathematics: What do grad students in math do all day?

Mathematics: What do grad students in math do all day?

by Yasha Berchenko-Kogan

A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.

The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.

What can you say?

@ryansmith3136
ryansmith3136 / mem-lower-bound.md
Created November 27, 2012 16:06
Memory Lower Bound: Go vs. C

Have you ever wondered about the least amount of memory a C or Go program will use on a 64bit Linux machine? Kr & I have, here is the results of our curiosity:

A simple C program:

void
main()
{
  for (;;) {
 }
@webmozart
webmozart / git-find-merge
Created November 15, 2012 14:32
Script to find the merge and PR a commit occurred in
#!/bin/bash
COMMIT=$1
BRANCH=$2
if [ -z $BRANCH ]; then
BRANCH="master"
fi
perl -ne 'print if ($seen{$_} .= @ARGV) =~ /10$/' \
<(git rev-list --ancestry-path --oneline $COMMIT..$BRANCH) \
@anthonybishopric
anthonybishopric / gist:3915637
Created October 19, 2012 00:50
Inline C in PHP
<?php
// This is largely stolen from test.php in the Inline_C repo (https://github.com/pear/Inline_C/blob/master/test.php)
require_once("C.php");
$function1 = <<<EOF
PHP_FUNCTION(times)
{
long i,j;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &i,&j) == FAILURE) {
@travist
travist / gist:3890434
Created October 15, 2012 01:47
OSM Player minimal code.
<html>
<head>
<title>Open Standard Media (OSM) Player: PHP Demo</title>
<script type='text/javascript' src="https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dark-hive/jquery-ui.css">
<script type="text/javascript" src="/osmplayer/bin/osmplayer.compressed.js"></script>
<link rel="stylesheet" href="/osmplayer/templates/default/css/osmplayer_default.css">
<script type="text/javascript" src="/osmplayer/templates/default/osmplayer.default.js"></script>
@rtomayko
rtomayko / testlib.sh
Last active December 14, 2025 13:15
Simple shell command language test library.
#!/bin/sh
# Usage: . testlib.sh
# Simple shell command language test library.
#
# Tests must follow the basic form:
#
# begin_test "the thing"
# (
# set -e
# echo "hello"
@philharvey
philharvey / 1-restdesk-example-one.md
Created September 22, 2012 17:14
REST & Hypermedia - "RESTDesk" Examples - Ruby Hoedown 2012

RESTDesk: First version

Business use case:

  • Allow app users for our single iPhone app to report bugs/feature requests via a native, in app help desk UI.
  • Users can report issues for our development team to address.

Non-hypermedia version

@MrMaksimize
MrMaksimize / commit-msg.sh
Created September 22, 2012 00:27
Commit message hook that appends story id
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".
@anastasop
anastasop / smiley.c
Created September 17, 2012 20:25
smiley.c
// the smiley program demonstrated by Russ Cox at http://research.swtch.com/acme
// it shows that the plan9 compiler http://plan9.bell-labs.com/sys/doc/comp.html fully supports UTF-8
// i tried to compile it with a recent version of the plan9 compiler running on vmware but it failed.
// it seems that older versions of the compiler supported sizeof(void) == 0
// anyway you get the idea
#include <u.h>
#include <libc.h>