Skip to content

Instantly share code, notes, and snippets.

View parmentf's full-sized avatar

François Parmentier parmentf

View GitHub Profile
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@QuanticPotatoes
QuanticPotatoes / tmux.conf
Last active March 12, 2024 08:43
Configuration tmux with powerline
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# -- navigation ----------------------------------------------------------------
# if you're running tmux within iTerm2
# - and tmux is 1.9 or 1.9a
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@PatrickJS
PatrickJS / factory-shared.es5.js
Last active January 6, 2024 04:18
Different examples of OOP "class" with "inheritance" done using JavaScript including languages that transpile into js. Take notice to the amount of boilerplate that's needed in ES5 compared to ES6. These examples all have the same interface with pros/cons for each pattern. If they seem similar that's whole point especially the difference between…
var EventEmitter = require('events').EventEmitter;
var _ = require('lodash');
// Factory shared
var makePerson = function() {
var person = {};
EventEmitter.call(person);
person.wallet = 0;
_.extend(person, personMethods)
return person;
@eyeseast
eyeseast / python.md
Last active November 6, 2023 01:32
How to set up Python in 2022

I have an updated version of this on my blog here: https://chrisamico.com/blog/2023-01-14/python-setup/.

Python

This is my recommended Python setup, as of Fall 2022. The Python landscape can be a confusing mess of overlapping tools that sometimes don't work well together. This is an effort to standardize our approach and environments.

Tools and helpful links:

  • Python docs: https://docs.python.org/3/
  • Python Standard Library:  - Start here when you're trying to solve a specific problem
# Node-WebKit CheatSheet
# Download: https://github.com/rogerwang/node-webkit#downloads
# Old Versions: https://github.com/rogerwang/node-webkit/wiki/Downloads-of-old-versions
# Wiki: https://github.com/rogerwang/node-webkit/wiki
# How: https://github.com/rogerwang/node-webkit/wiki/How-node.js-is-integrated-with-chromium
# 1. Run your application.
# https://github.com/rogerwang/node-webkit/wiki/How-to-run-apps
@NWCalvank
NWCalvank / fp.js
Created April 29, 2018 15:34
Transducers Explained | JavaScript
module.exports = {
compose,
concat,
};
function apply(x, f) {
return f(x);
}
function compose(...funcs) {
@maccman
maccman / jquery.onclose.coffee
Last active July 3, 2022 08:17
jQuery plugin to notify users if they close the page, and there are still some Ajax requests pending.
$ = jQuery
TRANSFORM_TYPES = ['PUT', 'POST', 'DELETE']
$.activeTransforms = 0
$(document).ajaxSend (e, xhr, settings) ->
return unless settings.type in TRANSFORM_TYPES
$.activeTransforms += 1
@bdougherty
bdougherty / README.md
Last active April 1, 2022 05:54
Play the Benny Hill theme song while installing npm modules

Add the function somewhere to your dotfiles. Works better if you npm install -g benny-hill first.