Skip to content

Instantly share code, notes, and snippets.

View FGRibreau's full-sized avatar
✍️
writing "#NoBullshit Tech-Lead" book https://getnobullshit.com

Francois-Guillaume Ribreau FGRibreau

✍️
writing "#NoBullshit Tech-Lead" book https://getnobullshit.com
View GitHub Profile
@joseanpg
joseanpg / extend_and_merge.js
Created August 15, 2012 21:55
Extend and Merge (don't overwrite properties that reference objects)
(function(carrier){
var hasOwn = Object.prototype.hasOwnProperty;
var slice = Array.prototype.slice;
function extend(obj,src){
for (var p in src){
if (hasOwn.call(src,p)) {
if (p in obj && typeof obj[p] === 'object' && obj[p]) {
extend(obj[p],src[p]);
#!/bin/sh
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
@tristanwietsma
tristanwietsma / index.html
Created April 30, 2013 04:44
Redis to websocket relay Relays a Redis channel to a websocket, or multiple channels to multiple sockets.
<html>
<head>
<title>Redis Listener</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
var conn;
var msg = $("#msg");
var log = $("#log");
function appendLog(msg) {
@codekoala
codekoala / PKGBUILD
Last active December 17, 2015 15:08
Customized PKGBUILD for btsync with user-specific profiles
# Maintainer: Dongsheng Cai <http://dongsheng.org>
# Maintainer: ava1ar < mail(at)ava1ar(dot)info >
pkgname=btsync
pkgver=1.0.134
pkgrel=4
pkgdesc="Automatically sync files via secure, distributed technology"
license=("custom")
arch=('i686' 'x86_64')
url="http://labs.bittorrent.com/experiments/sync.html"
@MaxGabriel
MaxGabriel / redis-yesod.md
Last active March 3, 2016 20:25
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 #-}
@antirez
antirez / mem.txt
Created September 15, 2016 15:17
127.0.0.1:6379> memory help
1) "MEMORY USAGE <key> [SAMPLES <count>] - Estimate memory usage of key"
2) "MEMORY OVERHEAD - Show memory usage details"
127.0.0.1:6379> memory overhead
1) "total.allocated"
2) (integer) 1014672
3) "startup.allocated"
4) (integer) 962496
5) "replication.backlog"
@streunerlein
streunerlein / gist:3332181
Created August 12, 2012 14:58
NPM Mirrors & Proxies

Definition

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: https://gist.github.com/3331671

Mirrors

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

@jasonhancock
jasonhancock / redis_loading
Last active October 5, 2017 23:38
A script to generate a progress bar tracking Redis' progress loading the data files on startup
#!/usr/bin/perl
# Copyright (c) 2012 Jason Hancock <jsnbyh@gmail.com>
#
# 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:
@guillaumebort
guillaumebort / 1.sql
Created May 25, 2012 15:17
Play 2.0/Anorm
# --- !Ups
CREATE TABLE users(
email VARCHAR(255) NOT NULL PRIMARY KEY,
name VARCHAR(255)
);
CREATE TABLE subjects(
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
title LONGTEXT NOT NULL,
@frazerh
frazerh / mac_osx_lion_haproxy_logging.txt
Created May 3, 2012 16:15
MACOSX LION HAProxy Logging
HA Proxy Logging on Lion
-------------------------
# To enable haproxy logging we need to change syslogd startup procedure to include its network listener.
# Backup syslogd start up file
sudo cp /System/Library/LaunchDaemons/com.apple.syslogd.plist /System/Library/LaunchDaemons/com.apple.syslogd.plist.bakup
# Convert binary file to xml to be human readable / editable