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
#ifndef __ARRAY_HEADER | |
#define __ARRAY_HEADER | |
// New Array: int *i = ARRAY(int, i); | |
#define ARRAY(t, n) calloc(0, sizeof(t)); size_t arr_##n##_count=0 | |
// Add item: ARPUSH(i, 12); | |
#define ARRPUSH(a, n) a=realloc(a, sizeof(a[0])*(arr_##a##_count+1));\ | |
a[arr_##a##_count]=n;\ | |
arr_##a##_count+=1; | |
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 bash | |
proj=${proj-`basename $(pwd)`} | |
MAKE=${MAKE-make} | |
builddir=${builddir-builder} | |
# this will be something like OpenBSD-amd64 or Darwin-x86_64 | |
platform=`uname -ms | sed 's/ /-/'` | |
command=$1 | |
shift |
This file has been truncated, but you can view the full file.
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
P3 | |
#PPM3 Converted by jpeg2ppm3 | |
336 408 | |
255 | |
254 255 247 255 255 253 103 97 107 92 82 106 105 87 125 192 166 214 165 130 186 166 122 181 176 125 184 182 127 185 181 123 181 178 123 181 177 127 188 171 126 191 166 125 195 166 128 201 189 120 187 189 120 187 187 120 187 188 121 188 188 121 188 188 123 189 188 123 189 187 125 190 192 130 195 189 129 193 186 126 190 186 126 190 185 126 190 185 126 190 182 123 187 180 121 185 163 125 200 160 126 200 159 129 201 160 133 204 168 134 208 179 133 208 188 125 206 192 119 201 197 119 203 195 120 203 191 124 203 189 128 205 192 131 208 200 133 210 209 135 214 216 134 216 203 141 226 198 143 227 190 147 229 177 150 229 159 152 229 137 153 228 116 156 226 97 160 229 80 165 232 69 172 239 58 177 245 47 178 246 40 181 250 37 184 254 34 185 255 31 184 254 31 184 255 30 182 255 31 178 255 33 178 255 37 180 255 39 180 255 37 180 255 33 178 255 29 179 255 31 183 255 32 185 255 31 183 255 29 179 255 31 176 255 34 177 255 38 179 255 29 174 255 30 175 255 31 176 255 34 176 255 36 17 |
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 bash | |
if [ $# -lt 1 ] | |
then | |
echo "USAGE: txt2pdf [filename] > output.pdf" | |
exit | |
fi | |
uname=$(uname) | |
if [[ $uname == Darwin ]] # OSX |
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 bash | |
VERSION=${1-v8.5} | |
git clone https://github.com/coq/coq -b v8.5 | |
install_desktop_file () { | |
d=~/local/share/applications/coq-ide.desktop | |
echo "[Desktop Entry]" > $d | |
echo "Name=Coq IDE" >> $d | |
echo "Exec=coqide" >> $d |
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
(* compile with: ocamlopt -a otest.ml -o otest.cmxa *) | |
class test = object(self) | |
val mutable pass : int = 0 | |
val mutable fail : int = 0 | |
val start_time = Unix.gettimeofday () | |
method private pass_test name s = | |
pass <- pass + 1; | |
Printf.printf "PASSED: %s (%fs)\n" name (Unix.gettimeofday () -. 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
from functools import partial | |
def chain(*fns, args=None): | |
'''Pass arguments through a series of functions | |
Parameters | |
---------- | |
*fns : list of functions | |
A list of functions to run consecutively | |
args : object or tuple, optional |
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
type time = | |
| Time of float | |
| Duration of float | |
exception Invalid_time | |
let to_float = function | |
| Time f -> f | |
| Duration f -> f |
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 sh | |
redis_path=${REDIS_SRC=/tmp/redis-src} | |
base=`pwd` | |
generated_header="// DO NOT EDIT - This file was automatically generated by redismod" | |
fetch_or_update_redis () { | |
git clone https://github.com/antirez/redis $redis_path || \ | |
(cd $redis_path && git pull origin unstable && cd $base) | |
} |
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 sh | |
# This is used to create a minimal GNOME desktop, typically from an image like: | |
# https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/weekly-builds/amd64/iso-cd/firmware-testing-amd64-netinst.iso | |
# Install core desktop components | |
apt install xdg-utils xclip build-essential gnome-core git neovim gnome-builder clang | |
# Install neovim + config | |
git clone https://github.com/zshipko/vim-config |
OlderNewer