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 / 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 / upsearch.sh
Created January 7, 2016 05:34
Search upward to find a certain file or directory. I don't know where I found this or if I wrote it myself.
upsearch() {
origdir=${2-$(pwd)}
test / == "$PWD" && cd "$origdir" && return || \
test -e "$1" && echo "$PWD" && cd "$origdir" && return || \
cd .. && upsearch "$1" "$origdir"
}
@blockloop
blockloop / crontab
Last active April 3, 2016 14:18
Automatically update letsencrypt certificates with crontab/cronjob
0 3 1 * * /var/www/_utils/update_certs.sh > /dev/null
package main
import (
"bufio"
"os"
"reflect"
"strconv"
"strings"
log "github.com/Sirupsen/logrus"
My sync settings. Managed by atom-sync-settings package.