Skip to content

Instantly share code, notes, and snippets.

View blockloop's full-sized avatar

Brett Jones blockloop

  • Lithic (privacy.com)
View GitHub Profile
@blockloop
blockloop / .vimrc
Created April 1, 2014 03:06
.vimrc
" vim: se ff=unix :
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Variables
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let $DBVIMRC = '~/Dropbox/configs/dotfiles/.vimrc'
let $DBGVIMRC = '~/Dropbox/configs/dotfiles/.gvimrc'
" Auto watch vimrc and reload it if it changes
augroup myvimrc
au!
@blockloop
blockloop / index.html
Last active August 29, 2015 14:03
PureCSS with Bootstrap 3's modal
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.5.0/pure-min.css">
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<a href="#myModal" role="button" class="pure-button-primary pure-button" data-toggle="modal">
@blockloop
blockloop / style.css
Last active August 29, 2015 14:03
Bootstrap style table-hover for PureCSS
table.table-hover tr:hover td {
background: #e5e5e5;
}
#!/usr/bin/python
import json
import bottle
from bottle import static_file, route, run, request, abort, response
import simplejson
import pymongo
from pymongo import Connection
import datetime
@blockloop
blockloop / gvim
Last active August 29, 2015 14:05
Launch gvim with cygwin like it should (reuse windows for files)
#!/usr/bin/env ruby
args=''
filepath=''
files=ARGV[0..-1]
if files
for file in files do
if File.exist? file
fp=`cygpath -w '#{file}'`.strip.gsub '\\', '/'
@blockloop
blockloop / upgrade-ghost-openshift.sh
Created January 11, 2015 03:22
Upgrade your openshift ghost blog to the latest version
#!/usr/bin/env bash
if [ ! -f package.json ]; then
echo "This script must be run from the ghost blog directory"
exit 1
fi
ZIP_URL=https://ghost.org/zip/ghost-latest.zip
PROJ_DIR=$(pwd)
TMP_DIR=$(mktemp -d -t ghost)
@blockloop
blockloop / server.go
Created May 12, 2015 03:10
Listening to RPC and HTTP simultaneously with golang
package main
import (
"errors"
"io"
"log"
"net"
"net/http"
"net/rpc"
)
@blockloop
blockloop / Gruntfile.js
Created May 26, 2013 03:27
hexo gruntfile generate example
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
watch: {
sourceFiles: {
files: ['themes/**','scaffolds/**','scripts/**','source/**','app.js'],
tasks: 'shell:hexoGen'
},
@blockloop
blockloop / MyCtrl.js
Last active December 18, 2015 03:38
localStorage with angularjs and node webkit
myApp.controller('MyCtrl', ['$scope','storageService',
function($scope, storageService) {
var brain = storageService.getBrain();
$scope.items = [];
$.extend($scope, brain); // load from memory
$scope.addItem = function(item) {
$scope.items.push(item);
$scope.refresh();
@blockloop
blockloop / rdio-media-keys.ahk
Created October 1, 2013 21:16
Control Rdio with key combinations using autohotkey. NOTE: this works with either the Rdio desktop app or a Chrome application shortcut but I've noticed that the Chrome shortcut works better and since the Rdio desktop application is basically just a Site-specific browser I just use Chrome.
#SingleInstance force
SetTitleMatchMode 2
RControl & UP::
Send {Volume_Up}
return
RControl & DOWN::