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<u.h> | |
#include<libc.h> | |
#define MAX(a, b) ((a) > (b) ? (a) : (b)) | |
/* Hilbert curve functions (from Wikipedia) */ | |
/* rotate/flip a quadrant appropriately */ | |
void rot(int n, int *x, int *y, int rx, int ry) | |
{ |
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<u.h> | |
#include<libc.h> | |
#define MIN /60.0 | |
#define DEG * 2 * PI / 360.0 | |
#define RAD * 360.0 / (2 * PI) | |
double longitude = 2.0 + 20.0 MIN; | |
const double Eccentricity = 0.0167; |
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/rc | |
urlfrom='http://www.transilien.mobi/TempReelSaisieSubmit.do?debutDepart=chatelet&debutArrivee=evry+courcouronnes' | |
urlto='http://www.transilien.mobi/TempReelSaisieSubmit.do?debutDepart=evry+courcouronnes&debutArrivee=chatelet' | |
url=$urlfrom | |
for(i) switch $i { | |
case -t | |
url=$urlto | |
} |
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<u.h> | |
#include<libc.h> | |
#include<json.h> | |
#include<bio.h> | |
#include<String.h> | |
const char url[] = "http://www.reddit.com/.json?feed=ffffffffffffffffffffffffffffffffffffffff&user=jbedo"; | |
/* Does the webfs query */ | |
String * |
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 rc | |
fn f { | |
n=$1 | |
if(! cat $f | cut -c1-$n | 9 grep -v '^[ ]+$' >/dev/null){ | |
x=`{f `{expr $n + 1}} | |
echo '.'$"x | |
} | |
} |
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 rc | |
. 9.rc | |
exec awk '{print " " $0}' |
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 rc | |
. 9.rc | |
exec sed 's/^ //' |
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 rc | |
. 9.rc | |
f=/tmp/fmt.$pid | |
fmt -l9999 | sed -e 's/([;\.])[ ]+/\1\n/g' > $f | |
cat $f | while(line=`{read}){ | |
if(! ~ $line "" ) |
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 | |
sha256 $* | awk '{match($0, /\(.*\)/); | |
path = substr($0, RSTART+1, RLENGTH-2) | |
print $NF, path}' |
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/awk -f | |
BEGIN{ | |
linelen=70 | |
indent=0 | |
braces=0 | |
FS="\\.[\t ]+" | |
} | |
/\\end\{/{indent--} |