Skip to content

Instantly share code, notes, and snippets.

@johnvilsack
johnvilsack / ST3_Keybindings
Created January 31, 2014 17:28
ST3_Keybindings
[
{"keys": ["super+`"], "command": "unexpand_tabs"},
{"keys": ["option+`"], "command": "expand_tabs"}
]
@johnvilsack
johnvilsack / ST3_PREFERENCES
Created January 31, 2014 17:28
ST3_PREFERENCES
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Theme - Flatland/Flatland Monokai.tmTheme",
"draw_white_space": "all",
"fade_fold_buttons": false,
"find_selected_text": true,
"font_face": "Source Code Pro for Powerline",
"font_size": 19,
"highlight_line": true,
@johnvilsack
johnvilsack / gist:8984172
Created February 13, 2014 21:26
Javascript Console Block for Chrome
<script type="text/javascript">
(function(){
var _z = console;
Object.defineProperty( window, "console", {
get : function(){
if( _z._commandLineAPI ){
throw "Sorry, Can't exceute scripts!";
}
return _z;
},
[ROOT] # source golang-crosscompile/crosscompile.bash
-sh: `go-alias': not a valid identifier
-sh: `go-crosscompile-build': not a valid identifier
-sh: `go-crosscompile-build-all': not a valid identifier
-sh: `go-all': not a valid identifier
-sh: `go-build-all': not a valid identifier
-sh: go-alias: command not found
-sh: go-alias: command not found
-sh: go-alias: command not found
-sh: go-alias: command not found
package main
import (
"fmt"
)
type ZipCoder interface {
fullName() string
}
@johnvilsack
johnvilsack / getJSON
Created June 24, 2014 19:48
getJSON in Go
package main
import (
"encoding/json"
"fmt"
)
type itemResult struct {
Query string `json:"query"`
Count int `json:"count"`
@johnvilsack
johnvilsack / gist:8a0653448d4877ffa7e0
Created June 25, 2014 14:24
Sample of getting JSON (dumping errors so don't use)
func apiGetItem(q string) *queryItem {
requestURL := "http://epoch.app/inventory/apiGetItemInfo.php?q=" + q
getQuery, _ := http.Get(requestURL)
defer getQuery.Body.Close()
resultQuery, _ := ioutil.ReadAll(getQuery.Body)
payload := &queryItem{}
ok := json.Unmarshal(resultQuery, payload)
return payload
}
@johnvilsack
johnvilsack / SampleJSONResult.js
Created June 25, 2014 20:22
Sample Go Application that grabs Item data from custom call
{
"query": "MISC01",
"count": 1,
"objects": [
{
"ITEM_ID": "MISC01",
"UPC": "867530900000",
"ITEM_DESC": "MISC ITEM $0-25",
"PROD_CLASS_ID": "MISC",
"AVAILABLE": "999",
@johnvilsack
johnvilsack / MYSQL-Select.go
Created July 14, 2014 18:55
Go: Idiomatic SELECT for MySQL
package main
import (
"database/sql"
"log"
_ "github.com/go-sql-driver/mysql"
)
var (
@johnvilsack
johnvilsack / Übersicht YouTube Widget
Created August 6, 2014 20:14
YouTube on your desktop, courtesy of Übersicht
command: "",
refreshFrequency: 138000,
render: function (output) {
return "<iframe width=\"1880\" height=\"1250\" src=\"//www.youtube.com/embed/lhdJODImBL8?version=3&autoplay=1&loop=1&controls=0&showinfo=0&playlist=lhdJODImBL8\" frameborder=\"0\" allowfullscreen></iframe>";
},
style: " \n\
top: -100px \n\