Skip to content

Instantly share code, notes, and snippets.

View DavidSouther's full-sized avatar
💭
You can statistics syntax, not semantics.

David Souther DavidSouther

💭
You can statistics syntax, not semantics.
View GitHub Profile
public class fact2 {
public static int factorial(int x) {
if (x==0) return 1;
else return x * factorial (x-1);
}
public static void main() {
int i, gobble;
i = 0;
.assembly extern mscorlib {}
.assembly addnums {}
.method static void main()
{
.entrypoint
.maxstack 11
.locals init ( int32 )
ldc.i4.s 10
stloc.0
.assembly extern mscorlib {}
.assembly addnums {}
.method static void main()
{
.entrypoint
.maxstack 15
.locals init ( int32 )
// a = 10
ldc.i4.s 10
@DavidSouther
DavidSouther / functional_tests.py
Created September 18, 2016 16:00
Obey the Testing Goat on Nitrous
from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0, size=(800, 600))
display.start()
browser = webdriver.Firefox()
browser.get('http://www.google.com')
print browser.title
browser.quit()
<!DOCTYPE html>
<html>
<head>
<title>NOAA GOES NA Recent</title>
<style>
body {
margin: 0;
}
.container {
@DavidSouther
DavidSouther / .db.json
Created November 14, 2015 14:10
Sample archives database
{"tape_1":{"label":"Tape 1","family":"tapes","medium":"3/4\" Tape","notes":"","stories":[{"slug":"Slug 1","date":"2015-11-07T00:17:32.806Z","format":"Unknown","runtime":"0:00","notes":"","reporter":"Unknown","photographer":"Unknown"},{"slug":"Slug 1","date":"2015-11-07T00:17:32.806Z","format":"Unknown","runtime":"0:00","notes":"","reporter":"Unknown","photographer":"Unknown"},{"slug":"Slug 1","date":"2015-11-07T00:17:32.806Z","format":"Unknown","runtime":"0:00","notes":"","reporter":"Unknown","photographer":"Unknown"},{"slug":"Slug 1","date":"2015-11-07T00:17:32.806Z","format":"Unknown","runtime":"0:00","notes":"","reporter":"Unknown","photographer":"Unknown"},{"slug":"Slug 1","date":"2015-11-07T00:17:32.806Z","format":"Unknown","runtime":"0:00","notes":"","reporter":"Unknown","photographer":"Unknown"},{"slug":"Slug 1","date":"2015-11-07T00:17:32.806Z","format":"Unknown","runtime":"0:00","notes":"","reporter":"Unknown","photographer":"Unknown"},{"slug":"Slug 1","date":"2015-11-07T00:17:32.806Z","format":"Unkn
{
"name": "...",
"version": "...",
"description": "KTVQ Video Archive Management.",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "git@github.com:DavidSouther/rupert.git"
},
@DavidSouther
DavidSouther / drag-directive.js
Last active September 3, 2015 17:20
An Angular 1.x dragging directive. The drag directive has several callback attributes available, the main being drag itself. For every drag event, the component has an opportunity to update itself.
var log = debug('draggable');
function Draggable(element, scope){
var apply;
if(scope.$apply){
apply = function(fn){
return function(){
var context = this;
var args = arguments;
@DavidSouther
DavidSouther / drag-directive.js
Created September 3, 2015 17:04
A hastily sanitized demo of a Draggable directive.
var log = debug('draggable');
function Draggable(element, scope){
var apply;
if(scope.$apply){
apply = function(fn){
return function(){
var context = this;
var args = arguments;
var config = {
name: 'rupert-auth-example',
hostname: 'localhost',
stassets: {
root: './src/client'
},
server: {
root: './src/server'
},
mongo: {