Skip to content

Instantly share code, notes, and snippets.

@burningTyger
burningTyger / gist:5581863
Created May 15, 2013 05:42
Sinatra style sheet generation route
# sass style sheet generation
get '/css/:file.css' do
halt 404 unless File.exist?("views/#{params[:file]}.scss")
time = File.stat("views/#{params[:file]}.scss").ctime
last_modified(time)
scss params[:file].intern
end
# Turn DD-WRT wireless radio on for business hours only. Verify wireless interface for your router model.
# Place in WebUI > Administration > Management > Cron
0 18 * * 1,2,3,4,5 root wl -i eth1 radio off
0 6 * * 1,2,3,4,5 root wl -i eth1 radio on
@burningTyger
burningTyger / exif_rename
Created January 9, 2014 14:40
quickly rename JPG to my preferred file format based on exif data
for i in *.JPG; do exiv2 -v -r '%Y-%-m-%d_%H-%M%-%S' rename "$i"; done
#set-option -g default-terminal "screen-256color"
#set -g default-terminal "screen-256color"
set -g mode-mouse on
set-window-option -g mode-mouse on
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
@burningTyger
burningTyger / gist:df7d5f7cec6b7a525328
Created June 10, 2014 11:08
neovim buffer overflow error
% nvim
*** buffer overflow detected ***: nvim terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x741cf)[0x7fea042751cf]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7fea0430cb2c]
/lib/x86_64-linux-gnu/libc.so.6(+0x10a9f0)[0x7fea0430b9f0]
nvim(eval_init+0x5a)[0x4e3853]
nvim(main+0x80)[0x42b5bc]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7fea04222ec5]
nvim[0x42d21c]
#!/bin/bash
#
# Copy data from a Time Machine volume mounted on a Linux box.
#
# Usage: copy-from-time-machine.sh <source> <target>
#
# source: the source directory inside a time machine backup
# target: the target directory in which to copy the reconstructed
# directory trees. Created if it does not exists.
#
@burningTyger
burningTyger / server.rb
Last active August 29, 2015 14:10 — forked from clody69/server.rb
require 'sinatra'
require 'haml'
$users = {'john' => {:roles => [:user] }, 'mike' => {:roles => [:user, :admin] } }
$tokens = {'123' => {:username => 'john', :expires_at => Time.now+60}}
helpers do
def authenticate_user!
@auth_token = auth_token
if $tokens.has_key?(@auth_token) && !$tokens[@auth_token][:expires_at].nil? && $tokens[@auth_token][:expires_at] > Time.now
@burningTyger
burningTyger / 29-prettify.conf
Created December 6, 2014 13:24
Arch better looking fonts for Chrome
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target='font' >
<edit mode='assign' name='rgba' >
<const>rgb</const>
</edit>
</match>
<match target='font' >
<edit mode='assign' name='hinting' >
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
<h1 class="text-center login-title">Sign in to continue to Bootsnipp</h1>
<div class="account-wall">
<img class="profile-img" src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=120"
alt="">
<form class="form-signin">
<input type="text" class="form-control" placeholder="Email" required autofocus>
<input type="password" class="form-control" placeholder="Password" required>
@burningTyger
burningTyger / README
Last active August 29, 2015 14:18 — forked from rwest/README
These two files should help you to import passwords from mac OS X keychains to 1password.
Assumptions:
1) You have some experience with scripting/are a power-user. These scripts worked for me
but they haven't been extensively tested and if they don't work, you're on your own!
Please read this whole document before starting this process. If any of it seems
incomprehensible/frightening/over your head please do not use these scripts. You will
probably do something Very Bad and I wouldn't want that.
2) You have ruby 1.9.2 installed on your machine. This comes as standard with Lion, previous
versions of OS X may have earlier versions of ruby, which *may* work, but then again, they