View Dafuq.php
<?php
echo 0.1+0.2==0.3?'true':'false';
// false
echo strval(0.1+0.2)==0.3?'true':'false';
// true
View keybase.md

Keybase proof

I hereby claim:

  • I am naouak on github.
  • I am naouak (https://keybase.io/naouak) on keybase.
  • I have a public key ASA2xrjA7VPfq06ppkd000hVcLWbSsBIzjgz0dCIH729Vwo

To claim this, I am signing this object:

View PdfRenderer.php
<?php
class PdfRenderer extends \mikehaertl\wkhtmlto\Pdf{
/**
* Add a page object to the output
*
* @param string $input either a URL, a HTML string or a PDF/HTML filename
* @param array $options optional options for this page
* @return static the Pdf instance for method chaining
*/
public function addPage($input,$options=array(),$type = null)
View matrix_multiplication.js
function multiply(a,b){
return a.map(function(v,i){
v.map(function(w,j){
var sum = 0;
for(var k = 0; k < v.length; k++){
sum+=a[i][k]*b[k][j];
}
return sum;
});
});
View words.sh
#!/bin/bash
# Liste des mots disponible ici : http://www.lexique.org/telLexique.php
WORD_COUNT=$1
if [ -z "$WORD_COUNT" ]; then
WORD_COUNT=1
fi
LC_NUMERIC="C"
View maybebetter.js
//Create a module for static middleware instanciation with a singleton
//Use the same singleton for app.use and variable routing.
//If there is some caching stuff going on, they should share the same cache which is a lot better.
var express = require("express");
var static = null;
module.exports = function(){
if(!static){
static = express.static(__dirname+"/public");
}
View script.js
var n = document.querySelectorAll(".animetitle");
var arr = [];
var min = null;
var max = null;
var total = 0;
var count = 0;
var noteCount = {};
for (var i = n.length - 1; i >= 0; i--) {
(function(n){
View gist:270df7ee30bc232e77b6
(function(){
function nativeTreeWalker() {
var walker = document.createTreeWalker(
document.body,
NodeFilter.SHOW_TEXT,
null,
false
),node,textNodes = [];
while (node = walker.nextNode()) {
if (node.nodeValue) {
View jtranslate
function JTranslate {
COMPONENT=$1;
COMPONENTUPPER=`echo $COMPONENT | sed y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/`;
touch ../../language/en-GB/en-GB.$COMPONENT.ini;
{ find . -exec grep -o `echo $COMPONENTUPPER"[A-Z0-9_]*"` {} \; | sort -u && find ../../language/en-GB/en-GB.$COMPONENT.ini -exec grep -o `echo $COMPONENTUPPER"[A-Z0-9_]*"` {} \; | sort -u;} | sort | uniq -u | sed s/$/=\"\"/ >> ../../language/en-GB/en-GB.$COMPONENT.ini;
vim ../../language/en-GB/en-GB.$COMPONENT.ini;
}
View gist:1952656
<?php
/**
* Add a single condition, or an array of conditions to the WHERE clause of the query.
*
* Usage:
* $query->where('a = 1')->where('b = 2');
* $query->where(array('a = 1', 'b = 2'));
*
* @param mixed $conditions A string or array of where conditions.
* @param string $glue The glue by which to join the conditions. Defaults to AND.