Skip to content

Instantly share code, notes, and snippets.

View reedobrien's full-sized avatar

Reed O'Brien reedobrien

View GitHub Profile
@malthe
malthe / less.app
Created September 22, 2011 08:14
less.app in bash
#!/bin/bash
if [ ! -d $1 ]; then
echo "Not a directory: $1"
exit -1
fi
while read line; do
filename="$(basename $line)"
if [ "${filename##*.}" == "less" ]; then
@ewalk153
ewalk153 / bufioEx.go
Created July 23, 2012 07:32
Bufio example
package main
import (
"bufio"
"fmt"
"os"
"time"
)
/* simple go app showing the use of a buffered writer */
@xcambar
xcambar / LICENSE
Last active November 20, 2015 12:57
Authenticated routing using AngularJS
Copyright (c) 2015 - Xavier Cambar <@ xcambar_gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
package main
// overview of crqs.go:
// this example app and supporting documentation enables you to query analytics data via the Core Reporting API in a completely headless manner, with
// no "popup" or user intervention required. it doesn't "handle" the returned data very well, as that will depend on what metrics/dimensions your
// query has. better handling of this is left as an exercise for the reader. :) follow the pre-reqs, change the ga* consts specific to your own app,
// and you should be good to go. uses google-api-go-client, analytics/v3, oauth, and oauth/jwt which you can download and install from
// https://code.google.com/p/goauth2/ and http://code.google.com/p/google-api-go-client/
// docs/pre-reqs:
@hnakamur
hnakamur / main.go
Created November 18, 2015 16:07
golang StartProcess with setuid
package main
import (
"flag"
"os"
"syscall"
)
func main() {
var uid uint
@arowla
arowla / Dockerfile.testing
Created April 20, 2017 17:56
Docker-Goconvey
FROM golang:1.7.5-alpine
USER root
ARG port
ARG app_path
ENV PORT=$port
ENV APP_NAME=github.com/smartystreets/goconvey
ENV APP_SRC_PATH=${GOPATH}/src/$app_path
@sanatgersappa
sanatgersappa / gist:4030649
Created November 7, 2012 10:10
Querying Sharepoint on Office365 with Go
package main
import (
"fmt"
"io/ioutil"
"net/http"
"log"
"regexp"
"strings"
)
@webcss
webcss / mithril-touch.js
Last active May 26, 2020 15:34
mithril-touch, consume touch and mouse events evenly with mithril
/*****************************************
/* DOM touch support module
/*****************************************/
if (!window.CustomEvent) {
window.CustomEvent = function (event, params) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
};
@MattWoelk
MattWoelk / workman.vim
Created March 25, 2011 23:45
workman keyboard layout for vim
"A blatant workman ripoff of bmx 007's beautiful colemak version called 'colqer' http://www.vim.org/scripts/script.php?script_id=2865 It makes vim so that you can insert and Ex mode in the workman keyboard layout, but can do the rest in qwerty.
"usage: put it in ~/.vim/plugin/ as workman.vim
"press \; in normal mode to activate/deactivate it.
"Keyboard is qwerty
" we want workman in insert mode
function IMapColemak()
if s:imap_colemak == 0
noremap! q q
noremap! w d
@freegenie
freegenie / mongo_backup.rb
Created August 18, 2010 09:04
Backup solution for mongodb which dumps gridfs items on filesystem
#!/usr/bin/env ruby
# This script is a backup tool for mongodb.
#
# The main purpose is to dump files from gridfs to filesystem,
# to take advantage of backup solutions based on tools like
# rsync.
# Developed against mongo 1.6.0