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
static const struct var confstr_l[] = { | |
#ifdef _CS_PATH | |
{"PATH", _CS_PATH}, | |
#endif | |
#ifdef _CS_POSIX_V7_ILP32_OFF32_CFLAGS | |
{"POSIX_V7_ILP32_OFF32_CFLAGS", _CS_POSIX_V7_ILP32_OFF32_CFLAGS}, | |
#endif | |
#ifdef _CS_POSIX_V7_ILP32_OFF32_LDFLAGS | |
{"POSIX_V7_ILP32_OFF32_LDFLAGS", _CS_POSIX_V7_ILP32_OFF32_LDFLAGS}, | |
#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
#!/usr/bin/env python3 | |
""" | |
Usage: ./rels.py link-relations-1.csv URL | |
URL should be e.g. 'http://www.example.org/assignments/relation/#' | |
""" | |
from typing import Any, Dict, Iterator, List | |
def stream(f: Iterator[str], base: str) -> Iterator[Dict[str, str]]: |
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 | |
git clone https://github.com/samawati/j1eforth | |
cd j1eforth | |
brew install gforth libpcap | |
LDFLAGS=-L/usr/local/opt/libpcap/lib CPPFLAGS=-I/usr/local/opt/libpcap/include gcc -o j1 -lpcap j1.c | |
gforth j1.4th | |
./j1 |
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 python3 | |
import re | |
import subprocess | |
import sys | |
pattern = r'(?s)("[^"\\]*(?:\\.[^"\\]*)*")|/\*(.*?)\*/|([^"/]+)|(.)' | |
token = re.compile(pattern) | |
def put(text): |
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 -Naur simplesha3.djb.c simplesha3.c | |
--- simplesha3.djb.c 2015-09-22 11:28:31.000000000 +0100 | |
+++ simplesha3.c 2015-11-11 11:59:16.000000000 +0000 | |
@@ -11,7 +11,7 @@ | |
int n; \ | |
if (!PyArg_ParseTuple(args,"s#:update",&m,&n)) return 0; \ | |
Keccak(r*8,m,n,p,h,d); \ | |
- return PyString_FromStringAndSize((const char *)h,d); \ | |
+ return PyBytes_FromStringAndSize((const char *)h,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
!#$&*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~ |
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 python3 | |
# choice.py, by Sean B. Palmer | |
import sys | |
countries = ["Albania", "Andorra", "Austria", "Belarus", "Belgium", "Bulgaria", | |
"Cyprus", "Czechoslovakia", "Denmark", "Estonia", "Faeroe Islands", "Finland", | |
"France", "Germany", "Gibraltar", "Greece", "Guernsey", "Hungary", "Iceland", | |
"Ireland", "Isle of Man", "Italy", "Jan Mayen", "Jersey", "Latvia", | |
"Liechtenstein", "Lithuania", "Luxembourg", "Malta", "Moldova", "Monaco", |
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
$ git diff | |
diff --git a/b2sum/makefile b/b2sum/makefile | |
index 806cc72..1171005 100644 | |
--- a/b2sum/makefile | |
+++ b/b2sum/makefile | |
@@ -1,5 +1,5 @@ | |
-CC=gcc | |
-CFLAGS=-std=c99 -O3 -march=native -I../sse -static -fopenmp | |
+CC=gcc-5 | |
+CFLAGS=-std=c99 -O3 -march=native -I../sse -fopenmp |
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 python3 | |
import sys | |
base58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" | |
def base_encode(octets, alphabet): | |
base = len(alphabet) | |
bignum = 0 | |
for (index, octet) in enumerate(reversed(octets)): |
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
"json" | |
import -> | |
"urllib.request" | |
import -> | |
"https://api.bitcoinaverage.com/ticker/global/all" | |
urllib | |
.request ->- module | |
.urlopen -->- http.client.HTTPResponse |
NewerOlder