Navigation Menu

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
Strophe.addConnectionPlugin("xdomainrequest", {
init: function() {
if (window.XDomainRequest) {
Strophe.debug("using XdomainRequest for IE");
// override thee send method to fire readystate 2
XDomainRequest.prototype.send = (function(oldSend) {
return function() {
oldsend.apply(this, arguments);
this.readyState = 2;
@FGRibreau
FGRibreau / gist:1678749
Created January 25, 2012 21:12 — forked from loginx/gist:810311
Underscore.js mixin to emulate ruby's Array#each_slice method.
/**
* Underscore.js mixin to emulate Ruby's Enumerable#each_slice method.
* http://www.ruby-doc.org/core/classes/Enumerable.html#M001514
*
*/
_.mixin({
// _.each_slice(obj, slice_size, [iterator], [context])
each_slice: function(obj, slice_size, iterator, context) {
var collection = obj.map(function(item) { return item; }), o = [], t = null, it = iterator || function(){};
@FGRibreau
FGRibreau / hack.sh
Created March 31, 2012 11:48 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2262723/hack.sh | sh
#
@FGRibreau
FGRibreau / merge.js
Created August 15, 2012 23:11 — forked from joseanpg/extend_and_merge.js
Merge as it should be ( == $.extend(true, {}, ...))
function myextend(/* args */){
var o = {}
, args = Array.prototype.slice.call(arguments)
, obj = args.shift()
, src = args.shift();
for (var p in src){
if (src.hasOwnProperty(p)){
if (hasOwn.call(obj,p) && typeof obj[p] === 'object' && obj[p] !== null) {
o[p] = myextend(obj[p],src[p]);
@FGRibreau
FGRibreau / hack.sh
Last active December 12, 2015 01:28 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@FGRibreau
FGRibreau / pr.md
Created March 25, 2013 09:06 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

<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) {
<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) {
@FGRibreau
FGRibreau / 1.sql
Created August 12, 2013 16:11 — forked from guillaumebort/1.sql
# --- !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,
@FGRibreau
FGRibreau / cors-nginx.conf
Last active May 26, 2020 11:06 — forked from alexjs/cors-nginx.conf
Slightly tighter CORS config for nginx
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#