Skip to content

Instantly share code, notes, and snippets.

View bradparks's full-sized avatar

Brad Parks bradparks

  • Fredericton, New Brunswick, Canada
View GitHub Profile

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
import nme.Assets;
import nme.display.Shape;
import nme.display.Sprite;
import format.SVG;
class SVGExample extends Sprite
{
var svg:SVG;
var shape:Shape;
@bradparks
bradparks / gist:7025742
Created October 17, 2013 14:19
My autohotkey config for a Mac keyboard (i'm using this with Windows running in a virtual machine on osx). Has some mappings for how I like to use Visual Studio (like I use Eclipse)
#+f::Send {Ctrl Down}{Shift Down}r{Ctrl Up}{Shift Up}
;-----------------------------------------
; Mac keyboard to Windows Key Mappings
;=========================================
Capslock::Ctrl
+Capslock::+Ctrl
; --------------------------------------------------------------
; NOTES
@bradparks
bradparks / gist:7047588
Created October 18, 2013 20:16
how to root a kindle fire 1st Generation device
How to root kindle fire 1st gen:
Download Kindle Fire Utility. You can probably find it listed on this nice FAQ:
http://forum.xda-developers.com/showthread.php?t=2166668
NOTE: MAKE SURE YOU'RE CONNECTED TO THE INTERNET when you run Kindle Fire Utility, as it downloads stuff when it's running.
Install drivers. If drivers don't install, go to Device Manager, and find the yellow exclamation mark driver (Kindle), and update the driver, and browser to the drivers folder in the KFU folder.
If you get stuck in a weird boot mode, after rooting. Your probably fine. Do this, basically run KFU and select the "boot mode" menu option, but don't have your kindle fire on when you run it. Just connected. KFU turns it on.
/*
Buttondown
A Markdown/MultiMarkdown/Pandoc HTML output CSS stylesheet
Author: Ryan Gray
Date: 15 Feb 2011
Revised: 21 Feb 2012
General style is clean, with minimal re-definition of the defaults or
overrides of user font settings. The body text and header styles are
left alone except title, author and date classes are centered. A Pandoc TOC
#!/bin/bash
### ABOUT: See: http://gist.github.com/366269
### Runs rsync, retrying on errors up to a maximum number of tries.
### On failure script waits for internect connection to come back up by pinging google.com before continuing.
###
### Usage: $ ./rsync-retry.sh source destination
### Example: $ ./rsync-retry.sh user@server.example.com:~/* ~/destination/path/
###
### INPORTANT:
#!/bin/bash
## incremental rsync backup script
## run hourly via cron, will take a back up every 24hrs for up to 7days.
## efficent use of space using hard links
## can handle computers been turned on / off
## executes n backup processes in parallel
# ------------- computers to backup -----------------------------------
# IP Address or fully qualified names here + remote backup directory
package ;
class DevTools {
macro static public function measure(e, ?msg:String) {
if (msg == null)
msg = haxe.macro.ExprTools.toString(e);
return macro @:pos(e.pos) {
var start = haxe.Timer.stamp(),
result = [$e];//wrapping in the array skews the result a bit, but avoids issues with Void
var duration = haxe.Timer.stamp() - start;
@bradparks
bradparks / .vrapperrc
Created January 22, 2014 15:41
Eclipse, using the Vrapper plugin, and the "Split Editor" plugin (part of Vrapper) can do VIM Splits, and navigate between them easily.... I map Ctrl+HJKL to moving between splits, and this .vrapperrc file (save in users home directory) allows this to happen easily! Find out more here: http://vrapper.sourceforge.net/documentation/?page=10
map <C-J> <C-W>j
map <C-K> <C-W>k
noremap <c-h> <c-w>h
noremap <c-l> <c-w>l

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a