Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am yvmarques on github.
  • I am yvan (https://keybase.io/yvan) on keybase.
  • I have a public key ASDs0EllpU40m544eI5rDvBPOoKyl0Jl4-HC6DAQmlPsuwo

To claim this, I am signing this object:

@yvmarques
yvmarques / advertising.js
Created December 5, 2016 23:04
A little script that remove 10% of the words from a given texte when the ad blocker is enabled.
var adblock = false;

Keybase proof

I hereby claim:

  • I am yvmarques on github.
  • I am yvan (https://keybase.io/yvan) on keybase.
  • I have a public key whose fingerprint is 957F 30FC 7D52 8940 094A A1D6 B79A 9E53 E62A 70A0

To claim this, I am signing this object:

@yvmarques
yvmarques / gist:5965197
Last active December 19, 2015 13:49
pre-commit hook to run the grunt release to ensure that all files static are also committed (runs only if js,less or css have been changed). I assume that all the generated files are stored in static's folder
#!/bin/sh
# stash unstaged changes, run release task, stage release updates and restore stashed files
PATH=$PATH:/usr/local/bin:/usr/local/sbin
NAME=$(git branch | grep '*' | sed 's/* //')
# Run the commit only if we have css,less or js files changed
files=$(git diff --cached --name-only --diff-filter=ACM | grep -E "\.(js|less|css)$")
if [ "$files" = "" ]
<?php
$key = 'SomeAgreedKey';
$algo = 'ripemd160';
$data = array(
'uid' => 1234,
'passwd' => '12345'
);
$token = hash_hmac($algo, implode(',', $data), $key);
{
"close_windows_when_empty": false,
"default_line_ending": "unix",
"draw_white_spaces": "all",
"ensure_newline_at_eof_on_save": true,
"fallback_encoding": "UTF-8",
"fold_buttons": false,
"font_size": 14.0,
"highlight_line": true,
"highlight_modified_tabs": true,
<?php
# Bench functional programming
$start = microtime(true);
$fact = function($x, $y = 1) use (&$fact) {
if ($x == 0) {
return $y;
}
return $fact($x - 1, $y * $x);
};
$fact(30000) . "\n";
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sticky footer &middot; Twitter Bootstrap</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- CSS -->