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
{
"apps": [{
"name": "My app",
"script": "server.js",
"instances": 2,
"port": 8080,
"exec_mode": "cluster_mode"
}],
"deploy": {
"production": {
#!/usr/bin/env bash
# exit code will be != 0 if "my-website-to-check" ssl certificate (or everything else) is invalid
wget -nv https://my-website-to-check.com > /dev/null

Keybase proof

I hereby claim:

  • I am fgribreau on github.
  • I am fgribreau (https://keybase.io/fgribreau) on keybase.
  • I have a public key whose fingerprint is 8B23 A013 21BD 8FB0 A0E1 6095 55EE 155C 4B46 0AE2

To claim this, I am signing this object:

function toBeProfiled(){
console.log(new Error('Show me the stack!'));
//Do something here
}
function launchApp(){
function doThing(){
console.debug(toBeProfiled);
toBeProfiled();
@FGRibreau
FGRibreau / Inception Code.js
Created July 30, 2010 16:18
The Inception code :)
function dream(lvl){
return lvl == -4 ? 'Inception done' : dream(--lvl);
}
dream(0);
@FGRibreau
FGRibreau / Detect_jQuery.js
Created July 30, 2010 17:01
How to detect if $ == jQuery
var isjQuery = function($){
return 'fn' in $ && !!$.fn.jquery;
}($);
//My original code: http://twitter.com/FGRibreau/status/19641898644
//piouPioum 2 cents: http://twitter.com/piouPiouM/status/19642960179
@FGRibreau
FGRibreau / The simple way.js
Created November 30, 2010 07:31
The simple way
$('#myIframe').contents().find('body #myElement').data('test', 'hello world');
//Will return {}
$('#myIframe').contents().find('body #myElement').data();
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 / peerguardian_macos.sh
Created March 2, 2011 11:20
Faire fonctionner PeerGuardian2 sur Mac
cd /Applications/
sudo ln -s /Applications/PeerGuardian.app/Contents/Resources/pploader.app PeerGuardian_loader.app
sudo ln -s /Applications/PeerGuardian.app/Contents/Resources/pplogger.app PeerGuardian_logger.app
open PeerGuardian_loader.app
open PeerGuardian_logger.app
@FGRibreau
FGRibreau / twitter-stream-api-bench.js
Created March 11, 2011 13:16
twitter stream sample api's simple benchmark
//https://github.com/jdub/node-twitter/
var twitter = require('twitter'),
sys = require('sys');
var twit = new twitter({
consumer_key: 'YOUR KEYS',
consumer_secret: 'YOUR KEYS',
access_token_key: 'YOUR KEYS',
access_token_secret: 'YOUR KEYS'
});