Skip to content

Instantly share code, notes, and snippets.

View jzawodn's full-sized avatar

Jeremy Zawodny jzawodn

View GitHub Profile
@antirez
antirez / lmdb.tcl
Created April 28, 2017 15:40
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@kburdett
kburdett / rpi_unifi.md
Last active March 24, 2022 19:51
Install Ubiquiti's UniFi Controller on a Raspberry Pi

Compatibility

I currently run Ubiquiti's UniFi Controller on a Raspberry Pi 3B without issue. I have tried with a Raspberry Pi 1B, but the application crashes on startup. I assume it is due to a lack of RAM. Presumably, it would run on a Raspberry Pi 2B as well (same amount of RAM), but I have not tested it on this model. YMMV.

Instructions

  1. Install Raspbian on a SD card. I tested this with Jessie Lite (headless)

  2. Use raspi-config to expand the filesystem, rename your PI, etc

@masotime
masotime / craigslist-scroll.js
Created December 20, 2015 04:21
Craigslist "infinite scroll"
function track() {
var scrollCount = 0;
var fetching = false;
return function () {
if($(window).height() + $(window).scrollTop() >= $('.content').offset().top + $('.content').outerHeight() && !fetching) {
scrollCount += 100;
fetching = true;
$.ajax('http://sfbay.craigslist.org/search/bka' + ( scrollCount > 0 ? '?s='+scrollCount : '' )).then(function(x) {
@ingydotnet
ingydotnet / word-parse.pl
Last active November 26, 2015 04:57
Parse words from a string of smushed together words with a single regexp
#!/usr/bin/env perl
use strict;
# Get all the letters from stdin:
my $input = do {local $/; <>};
$input =~ s/[^a-zA-Z]//g;
# All 3+ letter English words, longest to shortest:
my @long = grep {length > 2}
sort {length $b <=> length $a}
@trusktr
trusktr / DefaultKeyBinding.dict
Last active April 21, 2024 06:32
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@krists
krists / Turn CAPSLOCK to Ctrl.reg
Last active February 3, 2024 21:23
Remap Caps-Lock key to Ctrl in Windows 7/8
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
@omalley
omalley / tweet-by-user.py
Created March 3, 2013 06:28
A python script that uses the twitter api to find the most prolific tweeters in your feed.
#!/usr/bin/python
import base64
import hmac
import hashlib
import httplib
import json
import random
import string
import sys
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00