Skip to content

Instantly share code, notes, and snippets.

View yanneves's full-sized avatar

Yann イーベス Eves yanneves

View GitHub Profile
@yanneves
yanneves / .bashrc
Created February 25, 2016 22:20
Windows Git Bash runtime configuration
# Note: ~/.ssh/environment should not be used, as it
# already has a different purpose in SSH.
env=~/.ssh/agent.env
# Note: Don't bother checking SSH_AGENT_PID. It's not used
# by SSH itself, and it might even be incorrect
# (for example, when using agent-forwarding over SSH).
agent_is_running() {
@yanneves
yanneves / server-proxy.js
Created January 7, 2014 13:24
StackMob Node Proxy
// proxy all API requests
function proxy(method, path, headers, data) {
var defer = q.defer(), request,
pubKey = '****';
// filter paramaters contained in header, to avoid
// incorrectly identifying client domain and agent in request
headers = _.pick(headers, ['x-stackmob-api-key', 'x-stackmob-proxy-plain', 'x-stackmob-api-key-' + pubKey, 'accept', 'content-type', 'content-length', 'authorization']);
// format headers
headers = {
@yanneves
yanneves / gist:6c8204b4bc79e6e7c83c
Last active August 29, 2015 14:27
PlayCanvas Local Setup Node (Simple HTTP Server)
{
"name": "ludum-dare-33",
"version": "0.0.0",
"description": "Ludum Dare #LDJAM 33 Game Submission",
"main": " ",
"scripts": {
"start": "node_modules/.bin/http-server -p 51000 -c-1",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
[
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }
]
@yanneves
yanneves / gist:cf0119fea456c7b9f0dd
Created September 15, 2014 13:07
_.serialize Underscore.js mixin
_.mixin({
// Serialize key-value pairs of an object into urlencoded format
serialize: function(obj) {
var pairs = _.pairs(obj);
return _.reduce(pairs, function(memo, pair) {
var key = _.first(pair), value = _.last(pair);
value = _.isFunction(value) ? value() : value;
return memo + '&' + encodeURIComponent(key) + '=' + encodeURIComponent(value);
}, '').replace('&', '').replace(/%20/g, '+');
}