Skip to content

Instantly share code, notes, and snippets.

writing "#NoBullshit Tech-Lead" book

Francois-Guillaume Ribreau FGRibreau

writing "#NoBullshit Tech-Lead" book
View GitHub Profile
joseanpg / extend_and_merge.js
Created Aug 15, 2012
Extend and Merge (don't overwrite properties that reference objects)
View extend_and_merge.js
var hasOwn = Object.prototype.hasOwnProperty;
var slice = Array.prototype.slice;
function extend(obj,src){
for (var p in src){
if (,p)) {
if (p in obj && typeof obj[p] === 'object' && obj[p]) {
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
tristanwietsma / index.html
Created Apr 30, 2013
Redis to websocket relay Relays a Redis channel to a websocket, or multiple channels to multiple sockets.
View index.html
<title>Redis Listener</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
$(function() {
var conn;
var msg = $("#msg");
var log = $("#log");
function appendLog(msg) {
codekoala / PKGBUILD
Last active Dec 17, 2015
Customized PKGBUILD for btsync with user-specific profiles
# Maintainer: Dongsheng Cai <>
# Maintainer: ava1ar < mail(at)ava1ar(dot)info >
pkgdesc="Automatically sync files via secure, distributed technology"
arch=('i686' 'x86_64')
MaxGabriel /
Last active Mar 3, 2016
Connecting to Redis from Yesod

Connecting to Redis from Yesod

This is a quick run-through of how I connected to Redis from a Yesod site (which used the default scaffolding). There isn't much specific to Redis here, so this information should apply to connecting to any database or service from Yesod.

Background: Basics of Hedis

First, a brief intro of the basics of Hedis:

{-# LANGUAGE OverloadedStrings #-}
View mem.txt> memory help
1) "MEMORY USAGE <key> [SAMPLES <count>] - Estimate memory usage of key"
2) "MEMORY OVERHEAD - Show memory usage details"> memory overhead
1) "total.allocated"
2) (integer) 1014672
3) "startup.allocated"
4) (integer) 962496
5) "replication.backlog"
streunerlein / gist:3332181
Created Aug 12, 2012
NPM Mirrors & Proxies
View gist:3332181


Mirrors: standalone servers with complete copy of npm registry

Proxies: proxy to the database (couchdb) of npm registry, if only the npm registry server fails but the db works

## HowTo See this gist:


(+) means server is self updating (pulls newest stuff from offical registry when back online again)

jasonhancock / redis_loading
Last active Oct 5, 2017
A script to generate a progress bar tracking Redis' progress loading the data files on startup
View redis_loading
# Copyright (c) 2012 Jason Hancock <>
# 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
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is furnished
# to do so, subject to the following conditions:
View oauth2-restify.js
"use strict";
var restify = require("restify");
var users = require("./users");
// The users module will have a getAuthorizationFromAccessTokenAsync promise-returning export. (Convert to callbacks if you wish).
// It rejects in cause of not authorized, or fulfills with a { scope, customerId } object if the user is authorized.
// The scope property indicates which scopes the user corresponding to a given access token has.
module.exports = function authPlugin(serverRequest, serverResponse, next) {
kristjan /
Last active Jun 4, 2018
Google Spreadsheet row insertion example
# $auth from
# $spreadsheet_id from
# $worksheet_id from
curl \
--header "Authorization: GoogleLogin auth=$auth" \
--header 'Content-Type: application/atom+xml' \
-d @data.xml \
# Example data in data.xml