Skip to content

Instantly share code, notes, and snippets.

View 0livier's full-sized avatar
😸

Olivier Garcia 0livier

😸
View GitHub Profile

Keybase proof

I hereby claim:

  • I am 0livier on github.
  • I am 0livier (https://keybase.io/0livier) on keybase.
  • I have a public key ASD5QhHh6DRYHvQIHKz9ecpFTgGDSfg4uOkSXH7yqMskOgo

To claim this, I am signing this object:

$('.couchNumber input:last()').val(55); $('.couchNumber input:first-of-type').val(5);
@0livier
0livier / git-grep-over-time.sh
Created June 28, 2016 07:12
Git grep in all merges/commits into the current branch since a specif data
#!/usr/bin/env bash
if [ $# -eq 0 ]
then
self=$(basename $0)
echo "Usage: $self pattern directory"
exit 1
fi
pattern=$1
since="--since=2015-12-01"
@0livier
0livier / install_qa_tools.sh
Created June 18, 2015 07:50
Install QA tools
#!/bin/bash
mkdir -p ~/opt/php-tools
cd ~/opt/php-tools
wget https://phar.phpunit.de/phpunit.phar
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
wget https://github.com/sebastianbergmann/money/raw/master/build/tools/phploc.phar
wget http://getcomposer.org/composer.phar
wget -c http://static.phpmd.org/php/latest/phpmd.phar
@0livier
0livier / Atmosphere
Created May 1, 2015 09:43
Things you would not expect in ads for Google / landing pages.
<!-- GOOGLE ANALYTICS. ENTER YOUR CODE and UNCOMMENT block -->
<!--
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "YOURCODE";
urchinTracker();
</script>
-->
@0livier
0livier / randombg.js
Last active August 29, 2015 14:13 — forked from aloncarmel/randombg.js
function GetRandomBackground()
{
var url = 'http://unsplash.com/rss';
$.ajax({
url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&callback=?&q=' + encodeURIComponent(url),
async: false,
jsonpCallback: 'jsonCallback',
contentType: "application/json",
@0livier
0livier / test_argf.rb
Last active December 12, 2015 02:48
Testing ARGV/ARGF under several rubies. Not working with ruby 1.7.2 (1.9.3p327) 2013-01-04 302c706 on Java HotSpot(TM) 64-Bit Server VM 1.6.0_26-b03 [linux-amd64]
#!/usr/bin/env ruby
def foo(fh)
until fh.eof?
puts fh.readline
end
end
ARGV.replace [__FILE__]
foo(ARGF)
@0livier
0livier / curl.diff
Created November 15, 2012 17:27
Patches and configure line to get PHP 5.1.6 compiled on Centos 6
--- /root/php-5.1.4/php-5.1.4/ext/curl/interface.c.orig 2011-08-12 11:21:54.829741804 +0200
+++ /root/php-5.1.4/php-5.1.4/ext/curl/interface.c 2011-08-12 11:22:29.026246504 +0200
@@ -266,7 +266,7 @@
REGISTER_CURL_CONSTANT(CURLOPT_FTPAPPEND);
REGISTER_CURL_CONSTANT(CURLOPT_NETRC);
REGISTER_CURL_CONSTANT(CURLOPT_FOLLOWLOCATION);
- REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
+ // REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
REGISTER_CURL_CONSTANT(CURLOPT_PUT);
#if CURLOPT_MUTE != 0
@0livier
0livier / load_jquery.js
Created October 3, 2011 14:22
Load jQuery
var jq = document.createElement('script');
jq.src = 'http://jquery.com/src/jquery-latest.js';
jq.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(jq);
(function() {
if (document.defaultView.jQuery) jQueryLoaded(document.defaultView.jQuery);
else setTimeout(arguments.callee, 100);
})();
function jQueryLoaded($) {
@0livier
0livier / php-5.1.4-curl.diff
Created August 12, 2011 09:32
Diff for compiling PHP 5.1.4 with recent Ubuntu
--- /root/php-5.1.4/php-5.1.4/ext/curl/interface.c.orig 2011-08-12 11:21:54.829741804 +0200
+++ /root/php-5.1.4/php-5.1.4/ext/curl/interface.c 2011-08-12 11:22:29.026246504 +0200
@@ -266,7 +266,7 @@
REGISTER_CURL_CONSTANT(CURLOPT_FTPAPPEND);
REGISTER_CURL_CONSTANT(CURLOPT_NETRC);
REGISTER_CURL_CONSTANT(CURLOPT_FOLLOWLOCATION);
- REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
+ // REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
REGISTER_CURL_CONSTANT(CURLOPT_PUT);