This file contains 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
module Test where | |
data Range | |
= FromTo Integer Integer | |
deriving (Eq, Ord) | |
instance Show Range where | |
show (FromTo x y) = show x ++ " --> " ++ show y | |
x --> y |
This file contains 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
update_interval 1 | |
#out_to_x no | |
out_to_console yes | |
temperature_unit fahrenheit | |
#temperature_unit celsius | |
TEXT | |
${uptime_short}\ | |
::: ${mem}\ | |
::: ${mixer}%${if_mixer_mute} (M)${endif}\ |
This file contains 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
// author: Brian Mock <mock.brian@gmail.com> | |
#include <stdio.h> | |
typedef unsigned int uint; | |
double clamp(double, double, double); | |
uint pack_rgb(uint, uint, uint); | |
uint shade_color(uint, double); | |
void unpack_rgb(uint, uint*, uint*, uint*); |
This file contains 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
-------------------- Brian Mock ----------------------- | |
module Lab3 where | |
import List | |
-------------------- Problem 1 ----------------------- | |
(==>) = flip ($) | |
integerToDigit (i + 1) = digits !! i |
This file contains 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/env ruby | |
# | |
# Ruby ruby ruby! | |
# | |
def fibo(a=1, b=1) | |
n = 0 | |
yield 0, a | |
yield 1, b | |
loop do | |
a, b = b, a + b |
This file contains 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
#import <Foundation/Foundation.h> | |
#define I(n) [NSNumber numberWithInt:(n)] | |
int | |
main(int argc, char *argv[]) { | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
NSArray *ary = [NSArray arrayWithObjects: | |
I(4), I(5), I(1), I(0), I(6), nil | |
]; |
This file contains 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
- W-s Create new stack below | |
- W-w Create new stack above | |
- W-d Create new column right | |
- W-a Create new column left | |
- WA-j Move window to stack below | |
- WA-k Move window to stack above | |
- WA-l Move window to column right |
This file contains 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
"use strict"; | |
const util = require("util"); | |
const P = require("parsimmon"); | |
console.log(Date() + "\n"); | |
const _ = P.optWhitespace; | |
const tag = name => rest => |
This file contains 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
def start() = | |
let body = document.body | |
let root = React.createElement(GameView) | |
let container = document.getElementById("react-container") | |
let thing = React.render(root, container) | |
in do | |
set(app, "root", thing); | |
body.addEventListener("click", focusClickhole); | |
tick(); | |
end |
This file contains 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
# Good use of match | |
def compile(node) = | |
match node | |
case {type: "Add", a, b} => | |
["+", compile(a), compile(b)] | |
case {type: "If", condition, result, alternative} => | |
["if", compile(condition), compile(result), compile(alternative)] | |
# Bad use of match | |
def greet(person) = |