Skip to content

Instantly share code, notes, and snippets.

View gregory's full-sized avatar
🎯
Focusing

Grégory Horion gregory

🎯
Focusing
View GitHub Profile
@gregory
gregory / curl.md
Created March 8, 2018 16:41 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@gregory
gregory / Nylas_thread_bug.md
Created October 14, 2017 00:31
Nylas thread bug

Intention

As Nylas customer, we experienced quite some issues with distinct emails getting merged under the same thread. By documenting the use cases hopefully this will help understand that the algorithm is flawed for some common use cases & need to be addressed ASAP.

Context:

@gregory
gregory / proxy.js
Created July 31, 2017 17:02 — forked from shaond/proxy.js
var http = require('http');
var express = require('express');
var router = express.Router();
/* GET users listing. */
router.get('/', function(req, res) {
var request = require('request');
var url = req.query.url;

Just a Handy Nylas client based on curl

curl https://gist.githubusercontent.com/gregory/3c98a10cc009ae9f333cd0018523afc5/raw/40917888cd1e903bbd9ab0cbe33d6863728bcf4b/nylas.sh --output /usr/local/bin/nylas
chmod +x /usr/local/bin/nylas
/usr/local/bin/nylas
@gregory
gregory / a-results
Created April 16, 2017 07:49 — forked from jlongster/a-results
transducers w/immutable-js
# benchmark immutable.js with my transducers lib: https://github.com/jlongster/transducers.js
% node bench/immut.js
Immutable map/filter (1000) x 5,497 ops/sec ±2.63% (91 runs sampled)
transducer map/filter (1000) x 7,309 ops/sec ±0.73% (100 runs sampled)
Immutable map/filter (100000) x 62.73 ops/sec ±0.85% (67 runs sampled)
transducer map/filter (100000) x 80.15 ops/sec ±0.48% (71 runs sampled)
@gregory
gregory / introrx.md
Created April 3, 2017 07:37 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@gregory
gregory / meteor-async.md
Created July 31, 2016 18:48 — forked from possibilities/meteor-async.md
Meteor Async Guide

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished. This pattern can be seen all over Meteor's own codebase:

# A little Meteor CheatSheet about Iron-Router. (updated on a weekly basis)
# Check our Studio: https://gentlenode.com/
meteor add iron:router
meteor update iron:router
# Iron Router > Configuration
@gregory
gregory / config.ru
Created June 4, 2016 20:05 — forked from nathany/config.ru
Magical Unicorn Configuration for Heroku
# add something like this to config.ru
# see https://github.com/kzk/unicorn-worker-killer
if Integer(ENV['UNICORN_KILLER'] || 0) != 0
require 'unicorn/worker_killer'
# Max memory size (RSS) per worker
use Unicorn::WorkerKiller::Oom, (350*(1024**2)), (400*(1024**2)), 30, true
end
@gregory
gregory / config.ru
Created June 4, 2016 20:04 — forked from lucashungaro/config.ru
Unicorn + Heroku + worker_killer + GC vars tweak
# This file is used by Rack-based servers to start the application.
# GC_FREQUENCY = 8
# require "unicorn/oob_gc"
# GC.disable # Don't run GC during requests
# use Unicorn::OobGC, GC_FREQUENCY # Only GC once every GC_FREQUENCY requests
# # Unicorn self-process killer
require "unicorn/worker_killer"