Skip to content

Instantly share code, notes, and snippets.

Avatar

Steve Bian freespace

View GitHub Profile
View eeprom.txt
c0 0e 60 80 00 00 9f ff
ff ff e0 20 20 20 20 20
20 20 20 20 20 20 20 20
20 20 3f ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
@freespace
freespace / gen_sessions.py
Created Oct 9, 2014
Generates 15 minute sessions times when given an interval in time.
View gen_sessions.py
def sessions(starth, startmin, endh, endmin):
"""
starth: start hour, 24 hr
startm: start minute
endh: end hour, 24 hr
endmin: end minute
"""
curh = starth
curmin = startmin
while curh < endh or curmin< endmin:
View gist:8c91052fbff9e78f81ce
// START_DEFINITION
/**
* Fingerprint Tor authoritative directories enacting the directory protocol.
*/
fingerprint('anonymizer/tor/node/authority') = $tor_authority
and ($tor_directory or preappid(/anonymizer\/tor\/directory/));
// END_DEFINITION
// START_DEFINITION
/*
View float_scaling.c
#include <stdio.h>
int main(void) {
float f = 16777210;
int cnt;
for (cnt =0; cnt < 15; ++cnt) {
printf("cnt=%d\tf=%f\n", cnt, f+cnt);
}
return 0;
}
View hecs-repayment-years.py
# -*- coding: utf-8 -*-
"""
Created on Sat May 31 11:35:04 2014
@author: freespace
"""
def repayment_pc(earning):
thresholds = [ [59421, 0.04],
[65497, 0.045],
View 0001-Restores-stub-drain-function-to-avrisp2.patch
From 207ed833c4de43fa29dcbd97a3d1a7494bd9d3cc Mon Sep 17 00:00:00 2001
From: Shu Ning Bian <freespace@gmail.com>
Date: Wed, 18 Jul 2012 00:57:48 +1000
Subject: [PATCH] Restores stub drain function to avrisp2
---
avrdude/usb_libusb.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/avrdude/usb_libusb.c b/avrdude/usb_libusb.c
@freespace
freespace / gist:2585921
Created May 3, 2012
Backup of some arduino code to handle OV7670
View gist:2585921
#define SIO_C 2
#define SIO_D 4
#define SIO_CLOCK_DELAY 100
void setup()
{
pinMode(8,OUTPUT);
// while(1)
// {
@freespace
freespace / gist:1322095
Created Oct 28, 2011
Apple script to lock screen using keychain's menu item
View gist:1322095
(*
Probe Menu Bar
This script uses UI element scripting to return a list of every menuitem
of every menu for every application currently running.
If "Enable access for assistive devices" is not checked,
this script will open the Universal Access System Preference and ask
the user to check the checkbox.
@freespace
freespace / scrape.sh
Created Sep 14, 2011
Downloads webcam images periodically
View scrape.sh
#!/bin/bash
if [ $# -ne 2 ];
then
echo "Usage: $0 <url> <refresh period>"
exit 1;
fi
URL="$1"
@freespace
freespace / scroll.sh
Created Sep 12, 2011
macross proof version
View scroll.sh
#!/bin/bash
if [ $# -ne 1 ]; then
echo "you are doing it wrong"
echo "Usage: $0 <file>"
exit 1;
fi
IFS="
"