This file contains hidden or 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/zsh | |
test -e /dev/shm/once.db || touch /dev/shm/once.db | |
if grep -q "$*" /dev/shm/once.db | |
then echo "$* already in oncedb" >&2 | |
else | |
echo "$*" >> /dev/shm/once.db | |
"$@" | |
fi |
This file contains hidden or 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/bash | |
# selfrun.sh <executable> | |
# creates "<executable>.standalone" containing "." and extracting&running itself. | |
export _ROOT="/tmp/.nc.selfrun.$(uuidgen)-$(uuidgen)" | |
cat > "${1}.standalone" <<END | |
#!/bin/bash | |
export self="\$(readlink -f "\$0")" | |
if test -e $_ROOT | |
then cd $_ROOT | |
else |
This file contains hidden or 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
class IPC | |
dispatch: (name,...)=> -- call this on incoming calls | |
--print "dispatching: ",name,... | |
rawget(@@.__base, name) @, ... | |
call: (name, ...)=> | |
--print "calling: ",name,... | |
error "IPC.call: overload this to do outgoing calls" | |
client: (...)=> | |
old_mt=getmetatable @ | |
b=@@.__base |
This file contains hidden or 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
require "luarocks.loader" | |
lgi = require "lgi" | |
Gtk = lgi.require "Gtk" | |
Gtk.init! | |
window = with Gtk.Window | |
title: 'window' | |
default_width: 400 | |
default_height: 300 |
This file contains hidden or 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 | |
#NOTICE: to get the license terms of this program, just run it with the following arguments: | |
# mitnfa.sh 2016 "Kyra Zimmer" "[email protected]" | |
cat <<EOL | |
MIT +no-false-attribs License | |
Copyright © ${1:-$(date +%Y)} ${2:-$(git config --get user.name)} <${3:-$(git config --get user.email)}> | |
Permission is hereby granted, free of charge, to any person |
This file contains hidden or 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
import tweepy | |
f=open(".keys","r") | |
consumer_key=f.readline().rstrip().split()[0] | |
consumer_secret=f.readline().rstrip().split()[0] | |
access_token=f.readline().rstrip().split()[0] | |
access_token_secret=f.readline().rstrip().split()[0] | |
f.close() |
This file contains hidden or 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
import RAM, BankSwitcher from require 'ram' | |
ops=require 'ops' | |
rom=require 'rom' | |
eprint=(...)-> | |
for i in *{...} | |
io.stderr\write i..'\t' | |
io.stderr\write '\n' | |
bank1 = RAM! |
This file contains hidden or 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 <avr/io.h> | |
#include <util/delay.h> | |
#include <stdlib.h> | |
#include <avr/sleep.h> | |
#include <avr/interrupt.h> | |
uint16_t ADC_Read( uint8_t channel ) | |
{ | |
ADMUX = (ADMUX & ~(0x1F)) | (channel & 0x1F); | |
ADCSRA |= (1<<ADSC); |
This file contains hidden or 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 <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <math.h> | |
//#include <ftd2xx.h> | |
#include <errno.h> | |
//#include <asm/errno.h> | |
#include <libftdi1/ftdi.h> | |
#include <time.h> |
This file contains hidden or 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
#define PIN_TX 0x01 /* Orange wire on FTDI cable */ | |
#define PIX_RX 0x02 /* Yellow */ | |
#define PIN_RTS 0x04 /* Green */ | |
#define PIN_CTS 0x08 /* Brown */ | |
#define PIN_DTR 0x10 | |
#define PIN_DSR 0x20 | |
#define PIN_DCD 0x40 | |
#define PIN_RI 0x80 |