Skip to content

Instantly share code, notes, and snippets.

@chris-ramon
chris-ramon / gopath.sh
Created May 12, 2015 23:32
gopath config
> echo $GOPATH
/Users/chris/go_packages
> echo $GOROOT
/usr/local/Cellar/go/1.3.3/libexec
: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
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
});
});
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);
# Install gulp in your project devDependencies
npm install --save-dev gulp
@chris-ramon
chris-ramon / gist:bc1c2240468b124ac2e7
Last active February 25, 2016 05:08
webpack notes
# webpack
module.exports = {
entry: "./graphiql.js",
output: {
path: __dirname,
filename: "bundle.js"
},
module: {
loaders: [{
test: /\.jsx?$/,
@chris-ramon
chris-ramon / restangular.js
Created March 16, 2015 22:00
restangular notes
var Restangular = Restangular.withConfig(function(config) {
config.restangularFields.options = 'restangularOptions';
});
@chris-ramon
chris-ramon / killatom.go
Last active August 29, 2015 14:15 — forked from y-abe/killatom.go
package main
import (
"bytes"
"fmt"
"log"
"os/exec"
"strconv"
)
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)
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();
}