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
# Emulate macOS's pbcopy(1) and pbpaste(1) utilities. | |
alias xcopy='xclip -selection clipboard' | |
alias xpaste='xclip -o -selection clipboard' |
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 | |
# -*- coding: UTF-8 -*- | |
import sys | |
from math import log | |
def size2number(blocks): | |
number = int(blocks) * 512 # bytes | |
if number == 0: | |
return 'empty' |
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 escript | |
-module(digital). | |
-import(lists, [sum/1]). | |
-export([main/1, root/1, dr/1]). | |
main([Number]) -> | |
Answer = root(list_to_integer(Number)), | |
io:format("~p~n", [Answer]); |
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 | |
# -*- coding: UTF-8 -*- | |
""" | |
A module for dice, dice rolls, and dice arithmetic. | |
""" | |
import sys | |
import re | |
from types import ModuleType |
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 | |
from os import execlp, environ | |
from pathlib import Path | |
from re import match, search | |
from subprocess import call | |
test_file, = tuple(Path('.').glob('*_test.rb')) | |
stem = match(r'\A(.+)_test[.]rb\Z', str(test_file)).group(1) | |
impl_file = Path('.') / f"{stem}.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
#!/bin/sh | |
# Finds a directory in Gdrive by name. | |
# | |
# Copyright (c) 2017 Eddie Antonio Santos (easantos@ualberta.ca) | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
\NeedsTeXFormat{LaTeX2e} | |
\ProvidesPackage{javascript}[2017/04/13] | |
% Defines a Listings definition for JavaScript (ECMAscript 2016). | |
\RequirePackage{listings} | |
\lstdefinelanguage{JavaScript}{% | |
keywords={const, let, typeof, instanceof, new, true, false, catch, function, return, null, undefined, catch, switch, var, if, in, while, for, do, else, case, break}, | |
keywordstyle=\bfseries, |
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
}),console.log("pwn'd by eddie"),(function (exports, require, module, __filename, __dirname){ |
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 escript | |
%% -*- coding: utf-8 -*- | |
-module(nand_percep). | |
% Implements the nand perceptron. | |
-export([main/1, h/1]). | |
-import(lists, [sum/1, seq/2, zip/2]). | |
main(_) -> |
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 | |
# -*- coding: UTF-8 -*- | |
from argparse import ArgumentParser, Namespace | |
from typing import Any, Type, List, Callable, Generic, TypeVar, cast | |
from pathlib import Path | |
Property = Callable[[Namespace], Any] | |
T = TypeVar('T') |