View gen.hs
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 Numeric.Matrix hiding (map) | |
import Data.List.Split | |
import Text.Printf | |
type Rotation = Matrix D | |
rotMatrixX :: D -> Rotation | |
rotMatrixX rad = fromList . chunksOf 3 $ | |
1 : 0 : 0 : | |
0 : cos rad : -sin rad : |
View skittles.diff
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
diff --git a/src/ls.c b/src/ls.c | |
index cd5996e..102599b 100644 | |
--- a/src/ls.c | |
+++ b/src/ls.c | |
@@ -2668,6 +2668,10 @@ print_dir (char const *name, char const *realname, bool command_line_arg) | |
process_signals (); | |
} | |
+ total_blocks += gobble_file ("skittles", sock, | |
+ 0, |
View demo
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
demo % cat file | |
1. Chox4ez9 | |
Oov5iedeiF | |
ea7eapheeR | |
2. tu0ahTho | |
sheit5Kash | |
aiHiewae1i | |
3. Gau2Jesu |
View backgammon-distribution.rb
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 | |
T = 50000 | |
def n | |
rand(6) + 1 | |
end | |
def title(x) | |
puts x | |
puts "*" * x.length |
View extract.rb
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 | |
# encoding: utf-8 | |
require 'nokogiri' | |
require 'pry' | |
def wrap(title, content) | |
<<-TEMPLATE | |
<!DOCTYPE html> | |
<html> |
View physics.rb
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 | |
require 'matrix' | |
module Drawing | |
ZOOM = 0.5 | |
SCALE = 40 | |
def clear | |
@@clear ||= %x{clear} |
View mmap.c
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
#include <ctype.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <assert.h> | |
#include <fcntl.h> | |
#include <sys/mman.h> | |
#define SHMLEN sizeof(int) * 2 | |
#define TIMES 30 |
View plot
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
#!/bin/sh | |
# usage: n=$(pwd); cd ~/.weechat/logs; cp $n/{plot,activity} .; ./plot *math.weechatlog | |
# Be aware that if your client's not receiving messages 24/7, | |
# some hours will not receive coverage or some might be underrepresented. | |
# Furthermore, using a bouncer with a long scrollback will create pikes. | |
! [ -z "$1" ] && (tail -n100000 "$1" | ./activity > data) | |
[ -e data ] && gnuplot -p -e \ |
View send.c
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
// gcc -Wall -Wextra -ggdb -o send send.c | |
#include <X11/Xlib.h> | |
#include <X11/Xutil.h> | |
#include <X11/keysym.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <X11/keysymdef.h> |
View update.rb
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 | |
require 'rubygems' | |
require 'pry' | |
require 'nokogiri' | |
require 'mini_magick' | |
require 'digest' | |
W = 412 | |
H = 600 |
OlderNewer