This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OmniLog | |
attr_reader :available | |
def initialize(path) | |
@real = Logger.new(path) | |
@fake = Logger.new("/dev/null") | |
@available = Set.new | |
end | |
def add!(which) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
$door_count = 3 | |
$door_list = 0.upto($door_count - 1).to_a | |
$game_count = 10 * 1000 | |
def percent(numerator, denominator) | |
return "%5.2f%" %[100 * numerator.to_f / denominator.to_f] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set = [] | |
8.upto(1000).each { | x | | |
pop = [] | |
8.step(x - 8, 8).each { | y | | |
popeye_2 = y | |
popeye_1 = x - y | |
bats = popeye_1 * 0.250 | |
if bats.to_i == bats | |
hits = 3 * popeye_2 / 8 + bats | |
pop << [hits, popeye_1, popeye_2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function permute(array) { | |
// Identity | |
if(!array.length) { | |
return []; | |
} | |
var ret = [array], | |
len = array.length, | |
modlen = len - 1, | |
mover = array[modlen], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<ppm.h> | |
#include<math.h> | |
#include<string.h> | |
typedef float mask; | |
#define HEIGHT 512 | |
#define WIDTH 512 | |
#define PI 3.14159265 | |
typedef struct |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
############################################################# | |
# # | |
# Program: mzoom # | |
# Author: dw # | |
# Date: 2007-07-07 # | |
# Purpose: Explore the Mandelbrot set in bash! # | |
# Usage: See below # | |
# Version: 1.01.6930 # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<style> | |
textarea,input { width: 600px} | |
iframe { width: 800px; height: 300px} | |
span { display:inline-block; width: 100px;vertical-align:top} | |
</style> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// toplevel.js | |
// | |
// TopLevel enables you to template your HTML, CSS, and Javascript at the Top Level | |
// (c) 2014 chris mckenzie. see LICENSE for more details. | |
// https://github.com/kristopolous/TopLevel for the latest version. | |
// | |
// Parts of this code use Jeremy Ashkenas' underscore library, available at | |
// https://github.com/jashkenas/underscore and protected by the license specified | |
// therein. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
. ../ticktick.sh | |
`` | |
key = [ | |
{ "a" : [ 0, 1 ] }, | |
{ "b" : [ 2, 3 ] } | |
] | |
`` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: | |
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread | |
// then use as follows: | |
// | |
// query(term | [term, term, ...], term | [term, term, ...], ...) | |
// | |
// When arguments are in an array then that means an "or" and when they are seperate that means "and" | |
// | |
// Term is of the format: | |
// ((-)text/RegExp) ( '-' means negation ) |
OlderNewer