This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> echo $GOPATH | |
/Users/chris/go_packages | |
> echo $GOROOT | |
/usr/local/Cellar/go/1.3.3/libexec | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:noremap tt :tab split<CR> | |
:autocmd BufWritePost *.go :GoImports | |
set background=light | |
"unlet g:ctrlp_custom_ignore | |
"unlet g:ctrlp_user_command | |
"let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git' | |
let mapleader = "," | |
let g:go_highlight_functions = 1 | |
let g:go_highlight_methods = 1 | |
let g:go_highlight_structs = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var connect = require('gulp-connect'); | |
var livereload = require('gulp-livereload'); | |
var watch = require('gulp-watch'); | |
gulp.task('connect', function() { | |
connect.server({ | |
root : __dirname | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var livereload = require('gulp-livereload'); | |
var watch = require('gulp-watch'); | |
var http = require('http'); | |
var ecstatic = require('ecstatic'); | |
gulp.task('default', function() { | |
http.createServer( | |
ecstatic({ root: __dirname }) | |
).listen(8000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install gulp in your project devDependencies | |
npm install --save-dev gulp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# webpack | |
module.exports = { | |
entry: "./graphiql.js", | |
output: { | |
path: __dirname, | |
filename: "bundle.js" | |
}, | |
module: { | |
loaders: [{ | |
test: /\.jsx?$/, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Restangular = Restangular.withConfig(function(config) { | |
config.restangularFields.options = 'restangularOptions'; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"log" | |
"os/exec" | |
"strconv" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str := fmt.Sprintf(`{"key": "%s", "message": {"html": "%s", "text": "%s", "subject": "%s", "from_email": "%s", "from_name": "%s", "to": [ { "email": "%s", "name": "%s", "type": "%s" }]}}`, | |
s.Key, | |
s.Message.Html, | |
s.Message.Text, | |
s.Message.Subject, | |
s.Message.FromEmail, | |
s.Message.FromName, | |
s.Message.To[i].Email, | |
s.Message.To[i].Name, | |
s.Message.To[i].RType) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config(function($httpProvider) { | |
$httpProvider.interceptors.push('cacheSlayer'); | |
}) | |
.factory('cacheSlayer', function($injector, $q) { | |
return { | |
request: function(config) { | |
if (config.method === 'GET' && /^\/api/.test(config.url)) { | |
var sep = config.url.indexOf('?') === -1 ? '?' : '&'; | |
config.url = config.url + sep + 'cacheSlayer=' + new Date().getTime(); | |
} |