This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// sources: http://stackoverflow.com/a/4719222 | |
class A { | |
public static function className(){ | |
echo __CLASS__; | |
} | |
public static function test(){ | |
self::className(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Common bash function | |
alias sudo="sudo " # Hack, for sudo an aliases | |
alias ls="ls --color" | |
alias l="ls -lh --color" | |
alias ll="ls -lh --color" | |
alias lla="ll -a --color" | |
alias df="df -h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -f ~/.bash_aliases ]; then | |
. ~/.bash_aliases | |
fi | |
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then | |
. /etc/bash_completion | |
fi | |
if [ -d $HOME/.rbenv/bin ]; then | |
PATH="$HOME/.rbenv/bin:$PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python version: | |
from bs4 import BeautifulSoup | |
import requests | |
r = requests.get("http://www.google.fr/search?num=100&q=scrapping") | |
data = r.text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Foo\Bar\BazBundle\Util; | |
abstract class BaseManager | |
{ | |
protected $em; | |
protected $class; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Thomas Bley | |
* @licence GNU-FDL | |
* Source: http://we-love-php.blogspot.fr/2012/12/create-pdf-invoices-with-html5-and-phantomjs.html | |
*/ | |
var page = new WebPage(); | |
var system = require("system"); | |
// change the paper size to letter, add some borders | |
// add a footer callback showing page numbers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Mickaël Andrieu <mickael.andrieu@sensiolabs.com> | |
* @licence MIT | |
* Usage: casperjs casperPDF.js "[url]" [filename.<format>] | |
*/ | |
var casper = require('casper').create({ | |
pageSettings: { | |
paperSize: { | |
format: "Letter", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run: | |
casperjs index.js && convert *.jpg video.mpeg && gify video.mpeg out.gif && rm *.jpg video.mpeg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var clipRects = this.getElementsBounds('.list_item img.poster'); | |
var i = 0; | |
clipRects.forEach(function(clipRect) { | |
casper.capture(i+'.png', clipRect); | |
i++; | |
}); |
OlderNewer