Skip to content

Instantly share code, notes, and snippets.

View JeanSebTr's full-sized avatar

Jean-Sébastien Tremblay JeanSebTr

View GitHub Profile
@JeanSebTr
JeanSebTr / id_rsa_irongag.pub
Created February 20, 2013 15:55
muhahahahhaha
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDG8dZmmcYTVfofE2zjQU6knjc47IWlgzOCtmLi8U2F3VKQkeBKswpzkYn2mhPsUSj97McGzO0R2+U4OQbs0l0xUgpISmQZDutiC1hcydJbRNQdGHpKw/W1QwZrAus0CDYPiI10oaJRSzDZkMPxhda8Q1oIt+nO7lYxxz0jBCBg2jhPflzQPd3rC5aCxNRrsd02CWX3tIhwfUbNu/l0fj8cg34Oe+3F6Abb3xCVMskVPhftK8Vv4WQNZQVrPstSHYmi9e9DMnw2uiSSI9w+RrUedcJ6G3kNfB8GK+hzNQhpgFsHKOdm/sZQWhvZ7NpS8xYW/U5jNZxSksirke4s10kR jeansebtr@macpro-xpensia.local
(function() {
var modernizr = document.createElement('script');
modernizr.type = 'text/javascript';
modernizr.async = true;
modernizr.src = '//cdn.example.com/Modernizr/applicationcache-cssclasses-history-localstorage-shiv.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(modernizr, s);
})();
var fs = require('fs');
var $ = require('NodObjC');
$.import('Cocoa');
var App = $.NSApplication;
var methods = App.getInstanceMethods().sort();
// Copyright Joyent, Inc. and other Node contributors.
//
// 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:
//
@JeanSebTr
JeanSebTr / gists.js
Last active February 5, 2018 17:15
Async load of Github's gists without jquery in 31 lines of code
document.getElementsByClassName && (function(){
var _URL = /(https?:\/\/gist.github.com\/[^?#]+)(\?file=([a-z0-9_.-]+))?/i;
var gists = document.getElementsByClassName('gist');
function embed(url, i, tag) {
window['embed_gist_'+i] = function(gist) {
var tmp = document.createElement('div');
tmp.innerHTML = gist.div;
tag.parentNode.replaceChild(tmp.firstChild, tag);
var css = document.getElementsByClassName('gist_css');
for(var i=0; i<css.length; i++) {
@JeanSebTr
JeanSebTr / fromObject.js
Created November 24, 2012 01:28
Deserializing Mongoose document (i.e. JSON to Doc)
var db = /* ... */
var obj = {
_id: '21245b528adfad75b0480baf',
email: 'jeansebtr@xpensia.com',
username: 'jeansebtr',
fullname: 'Jean-Sébastien Tremblay'
};
@JeanSebTr
JeanSebTr / defi.js
Created March 9, 2012 00:24
Défi du opencode #3
function methode(txt) {
var res = {};
for(var i=0;i<txt.length;i++) {
res[txt[i]] = (res[txt[i]] || 0) + 1;
}
return res;
}
var txt = 'ahsgdasdfjsa';
@JeanSebTr
JeanSebTr / basic_object.js
Created February 6, 2012 22:06
Article de blog sur Javascript OO
var objet_simple =
{
nom: "hello",
type: "world"
};
objet_simple.fr = "bonjour";
@JeanSebTr
JeanSebTr / bookmarklet.js
Created February 1, 2012 00:31
Bookmarklet for viewing spam video without liking them
var a=[]
,e=document.body.parentElement
,r=[
/https?:\/\/[a-z0-9_.-]*youtube\.com[\/a-z0-9_-]*/i,
/https?:\/\/[a-z0-9_.-]*dailymotion\.com[\/a-z0-9_-]*/i,
/https?:\/\/buzztwo\.com\/videos\.php\?vid=[a-z0-9]+/i
]
,m=[
/<embed .*\/>/i
]
@JeanSebTr
JeanSebTr / cloudfoundry-install-notes.txt
Created January 18, 2012 21:48
Notes for a successful installation of cloudfoundry on Amazon's EC2
Start with a Ubuntu 10.04 LTS AMI
- 32 bits : ami-71dc0b18
- 64 bits : ami-55dc0b3c
Open required ports in your security group
- 22 (only for the installation)
* Router
- 80
* Cloud controller
- ...