Skip to content

Instantly share code, notes, and snippets.

View yanneves's full-sized avatar

Yann イーベス Eves yanneves

View GitHub Profile
@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: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, '+');
}
[
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }
]
@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": {
@yanneves
yanneves / index.html
Last active February 13, 2017 23:07
Mocha Programmatic API w/ JSPM
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Example Mocha Test</title>
</head>
<body>
<!-- Required for browser reporter -->
<div id="mocha"></div>
@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 / gist:3f600b5f089eb239803a
Last active March 18, 2016 10:56
Technical task planning template
=====
xSP
= As a <type of consumer>, I would like <some feature>, so that I may <benefit somehow>
...
=====
Stories
=====
=====
@yanneves
yanneves / index.html
Created June 3, 2016 10:59
Layout - Content - Presentation divide
<!-- LAYOUT -->
<ul>
<li>
<button></button>
</li>
<li>
<button></button>
</li>
<li>
<button></button>
@yanneves
yanneves / iso-countries.json
Created November 9, 2016 16:28
ISO JSON Countries & Nationalities
[
{"label":"Andorra"},
{"label":"United Arab Emirates"},
{"label":"Afghanistan"},
{"label":"Antigua and Barbuda"},
{"label":"Anguilla"},
{"label":"Albania"},
{"label":"Armenia"},
{"label":"Angola"},
{"label":"Antarctica"},
@yanneves
yanneves / keybase.md
Created April 30, 2017 09:43
keybase.md

Keybase proof

I hereby claim:

  • I am yanneves on github.
  • I am yanneves (https://keybase.io/yanneves) on keybase.
  • I have a public key whose fingerprint is D9FB 11A7 436F 30C2 72FA 99D1 3A99 F798 D6FE A51B

To claim this, I am signing this object: