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
DISPLAY= socat TCP-LISTEN:1337,crlf,fork exec:"mplayer -vo caca -quiet /home/lmarshall/Downloads/Rick_Astley_-_Never_Gonna_Give_You_Up_dQw4w9WgXcQ.mp4",pty |
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
template<class T> | |
struct PolyBox { | |
typedef std::unique_ptr<T> Ptr; | |
/* Regular constructor */ | |
PolyBox(Ptr&& p): ptr(std::move(p)) {} | |
/* Copy */ | |
PolyBox(const PolyBox& t) : ptr(Ptr(t.ptr->clone())) {} | |
PolyBox& operator=(const PolyBox& t) { |
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
def ingest(s): | |
counts = {} | |
for c in s: | |
if not c in counts: | |
counts[c] = 0 | |
counts[c] += 1 | |
return counts | |
import math |
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
SOCK_LINK=/tmp/ssh_auth_sock_link | |
start_ssh_agent() { | |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_ed25519 | |
ln -vsnf $SSH_AUTH_SOCK $SOCK_LINK | |
} | |
if [[ $- == *i* ]] && ! [[ -e $SOCK_LINK ]]; then | |
# Agent socket link doesn't exist - assume agent isn't running | |
start_ssh_agent | |
fi |
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
months = [ | |
("January", 3), | |
("February", 0), | |
("March", 3), | |
("April", 2), | |
("May", 3), | |
("June", 2), | |
("July", 3), | |
("August", 3), | |
("September", 2), |
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
'VGA Driver by Lee Marshall | |
CON | |
_clkmode = XINPUT + PLL16X | |
_xinfreq = 4_000_000 | |
VAR | |
long bitmapbase[1536] | |
byte cog | |
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
source_list = open("$SOURCE_LIST_FILE", "w") | |
lines = gdb.execute('info sources', to_string=True).split('\n') | |
for line in lines: | |
line = line.strip() | |
if not line.startswith('/'): | |
continue | |
parts = line.split(',') | |
for part in parts: | |
source_list.write(part.strip() + '\n') | |
source_list.close() |
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
get_win_path() { | |
P=${PWD/\/usr\/lib/\/windows\/system32} | |
P=${P/\/usr\/bin/\/program files} | |
P=${P/$HOME/\/Documents and Settings\/$USER} | |
P=$(echo ${P//\//\\} | tr '[:lower:]' '[:upper:]') | |
echo "C:$P" | |
} | |
export PS1="\$(get_win_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
function AsyncRateLimiter() { | |
/* Operation is in progress */ | |
this.doingThing = false; | |
/* Next operation to do after this one */ | |
this.nextFn = false; | |
} | |
AsyncRateLimiter.prototype.submit = function(fn) { |
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 <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <signal.h> | |
#include <stdbool.h> | |
#include <time.h> |
NewerOlder