Skip to content

Instantly share code, notes, and snippets.


Florian Margaine ralt

View GitHub Profile
ralt /
Created Aug 26, 2015
Always have a symlink to your last screenshot
View gist:10451958
Why should I choose this or this class? Isn't there any skill that's available only to them later on?
What does clicking on "validate" (email) do? Nothing happens, and I don't get any mail.
Sending password in clear by mail?
Otherwise the tutorial is nice. I don't like the gameplay, but it's just me :-)
ralt / gist:d1e07c3c77813383734b
Last active Aug 29, 2015
cpp preprocessor for JS source
View gist:d1e07c3c77813383734b
$ cpp -P -nostdinc test.js bundle.js
# OR
$ cpp -P -nostdinc test.js
# To give parameters, use -D, like this:
$ cpp -P -nostdinc -D DEV test.js
View *scratch*.js
router.get('/set-authentication', function(req, res) {
var groups = global.mysql.authentication.groups;
db.Group.find(groups, createIfNotExists);
function createIfNotExists(err, results) {
if (err) return res.send(500);
var missing = findMissing(groups, results);
db.Group.insert(missing, createAdminUser);
View gist:242235e99a8144d855af
Write a blog post about "return ASAP".
$user = getUser();
if ($user) {
$group = getGroup($user);
if ($group) {
// do something
ralt / gist:dfdf232656870815e57d
Created Jul 8, 2014
Fix iolib compilation error
View gist:dfdf232656870815e57d
$ sudo apt-get install libfixposix-dev
ralt / gist:86662df4065f1c3788df
Last active Aug 29, 2015
Share your js console
View gist:86662df4065f1c3788df
A sample of how this could work:
<output id="output"></output>
<input type="text" id="input">
View gist:3735ab019bd8cb36c81e
./configure --prefix=/opt/php-zts --bindir=/opt/php-zts/bin --with-config-file-scan-dir=/opt/php-zts/modules.d --with-zlib --disable-phar --enable-debug --enable-maintainer-zts
View gist:27b89dabd815e4876ee5
\lfoot{a very long left header}
\rfoot{a very long right header}
View gist:d0be3c04223e17e40397
// example of how you do stuff as user x
route('/dashboard', function() { loadDashboard(getSession('user_id')); });
// example of link to become another user
// make sure it's admin only
route('/changelink/:userid', requireAdmin, function(req) {
setSession('is_faking', getSession('user_id'));
setSession('user_id', req.params.userid);