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
Show hidden characters
{ | |
"env": | |
{ | |
"es6": true, | |
"node": true | |
}, | |
"extends": "eslint:recommended", | |
"rules": | |
{ | |
"linebreak-style": ["error", "unix"], |
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
# Docker for Windows/Docker Machine is mounting C:\Users\ of your Windows to //c on the Docker host. | |
sudo touch /usr/local/bin/docker | |
sudo chmod +x /usr/local/bin/docker | |
cat EOF > /usr/local/bin/docker | |
#!/bin/bash | |
ARGS=`echo -n "$@" | sed -E 's/\/mnt\/([a-z])\//\/\/\1\//g'` | |
eval /usr/bin/docker $ARGS | |
EOF | |
## great success |
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
// wire up exec for serverless invokes with mock test data event inputs | |
require('dotenv').load(); | |
const exec = require('child_process').exec | |
, assert = require('assert') | |
const stream = require('stream'); | |
const expect = require('chai').expect; |
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
#https://gist.github.com/Chandler/fb7a070f52883849de35 SEE HERE | |
# MIT License | |
# Copyright (c) 2016 Chandler Abraham | |
# 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 |
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
set -g terminal-overrides 'xterm*:smcup@:rmcup@' | |
# ~/.tmux.conf | |
# | |
# See the following files: | |
# | |
# /opt/local/share/doc/tmux/t-williams.conf | |
# /opt/local/share/doc/tmux/screen-keys.conf | |
# /opt/local/share/doc/tmux/vim-keys.conf | |
# |
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
function h() { | |
if [ -z "$1" ] | |
then | |
history | |
else | |
history | grep "$@" | |
fi | |
} | |
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
func getUserFromRequest(r *http.Request) *model.User { | |
//Authorization: bearer {token} | |
//auth0 user is in user | |
jwtContext := context.Get(r, "user") | |
auth0Id := ((jwtContext.(*jwt.Token)).Claims).(jwt.MapClaims)["sub"] | |
user := model.GetUserFromAuthId(auth0Id.(string)) | |
return user | |
} |
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
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<div className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<h2>Welcome to React</h2> | |
</div> | |
<p className="App-intro"> | |
To get started, edit <code>src/App.js</code> and save to reload. |
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
// Read the content | |
var bodyBytes []byte | |
if r.Request.Body != nil { | |
bodyBytes, _ = ioutil.ReadAll(r.Request.Body) | |
} | |
// Restore the io.ReadCloser to its original state | |
r.Request.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBytes)) | |
// Use the content | |
requestMetrics.Body = string(bodyBytes) |
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
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.1.4' | |
# Use sqlite3 as the database for Active Record | |
gem 'sqlite3' | |
# Use SCSS for stylesheets | |
gem 'sass-rails', '~> 4.0.3' | |
# Use Uglifier as compressor for JavaScript assets |