Skip to content

Instantly share code, notes, and snippets.

View ralt's full-sized avatar

Florian Margaine ralt

View GitHub Profile
@ralt
ralt / gist:f4bd9e9133dee42e36a6
Last active April 16, 2018 19:30
The Contributors Army

tl;dr we're lazy, we're coders.

Let's make use of that.

  • We don't like to start off new projects and write all the booooring boilerplate
  • We like to fiddle with code and fix it
  • We like recognition
  • We're quickly bored

Hence, I present to you my idea:

// 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);
});
\documentclass{report}
\usepackage{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{LEFT}
\chead{CENTER}
\rhead{RIGHT}
\lfoot{a very long left header}
\cfoot{}
\rfoot{a very long right header}
@ralt
ralt / gist:3735ab019bd8cb36c81e
Created September 23, 2014 16:30
config.nice for php
./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
@ralt
ralt / gist:86662df4065f1c3788df
Last active August 29, 2015 14:04
Share your js console
jsfiddle: http://jsfiddle.net/FRsGS/2/
A sample of how this could work:
HTML:
<output id="output"></output>
<input type="text" id="input">
JS:
@ralt
ralt / gist:dfdf232656870815e57d
Created July 8, 2014 18:57
Fix iolib compilation error
$ sudo apt-get install libfixposix-dev
Write a blog post about "return ASAP".
e.g.
```
$user = getUser();
if ($user) {
$group = getGroup($user);
if ($group) {
// do something
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);
@ralt
ralt / gist:d1e07c3c77813383734b
Last active August 29, 2015 14:02
cpp preprocessor for JS source
/*
$ 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
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 :-)