This file contains hidden or 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
hub(){ | |
REPO="$(git remote -v | grep fetch | sed 's/origin//' | tr ':' '/' | sed 's/.*git@/http:\/\//' | sed 's/.git *([a-z]*)//')" | |
if [ "$(whereis xdg-open)" ] ; then | |
cmd="xdg-open" | |
else | |
cmd="open" | |
fi | |
$cmd "$REPO" | |
} |
This file contains hidden or 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 | |
$url = urlencode('http://wordpress.org'); | |
$width = 200; | |
$request = "http://s.wordpress.com/mshots/v1/$url?w=$width"; | |
echo "Link: $request"; |
This file contains hidden or 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
cd /tmp | |
curl http://pecl.php.net/get/mongo/1.2.11 | tar xzf - | |
cd mongo-1.2.11 | |
/app/php/bin/phpize | |
./configure --with-php-config=/app/php/bin/php-config | |
make && make install | |
cd .. |
This file contains hidden or 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
mkdir -p /app | |
# Prepare the filesystem | |
mkdir -p /tmp/build | |
cd /tmp/build | |
# Compiling Apache | |
curl http://www.us.apache.org/dist/httpd/httpd-2.2.24.tar.gz | tar xzf - |
This file contains hidden or 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 | |
defined('STDERR') OR define('STDERR', fopen('php://stderr', 'w')); | |
logger::implement('write', function ($type, $message) { | |
$remote = server('REMOTE_ADDR'); | |
$message = preg_replace('/[\r\n]+\s*/', ' ', $message); | |
fputs(STDERR, "$remote [$type] $message\n"); | |
}); |
This file contains hidden or 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] | |
;;;;;;;;;;;;;;;;;;; | |
; About php.ini ; | |
;;;;;;;;;;;;;;;;;;; | |
; PHP's initialization file, generally called php.ini, is responsible for | |
; configuring many of the aspects of PHP's behavior. | |
; PHP attempts to find and load this configuration from a number of locations. |
This file contains hidden or 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
ek@lamat:~/.local/lib/git/autoupload$ ruby listen.rb | |
/home/ek/.local/lib/git/autoupload/uploads/screenshot4.png | |
http://i.imgur.com/miGkN.png | |
/home/ek/.local/lib/git/autoupload/uploads/.listen_test | |
/home/ek/.local/lib/git/autoupload/imgur.rb:21:in `upload': undefined method `[]' for nil:NilClass (NoMethodError) | |
from /home/ek/.local/lib/git/autoupload/imgur.rb:27:in `upload_file' | |
from listen.rb:19:in `block in <main>' | |
from /usr/local/lib/ruby/gems/1.9.1/gems/listen-0.4.5/lib/listen/listener.rb:190:in `call' | |
from /usr/local/lib/ruby/gems/1.9.1/gems/listen-0.4.5/lib/listen/listener.rb:190:in `on_change' | |
from /usr/local/lib/ruby/gems/1.9.1/gems/listen-0.4.5/lib/listen/listener.rb:199:in `block in initialize_adapter' |
This file contains hidden or 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
vh(){ | |
paths[0]="/etc/apache2/sites-available" | |
paths[1]="/etc/apache2/extra/httpd-vhosts.conf" | |
paths[2]="/private/etc/apache2/virtualhosts" | |
paths[3]="/private/etc/apache2/extra/httpd-vhosts.conf" | |
for i in 0 1 2 3 | |
do | |
if [ -f "${paths[$i]}" ] || [ -d "${paths[$i]}" ]; then | |
conf="${paths[$i]}" |
This file contains hidden or 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 | |
require 'vendor/tetlphp/framework/initialize.php'; | |
import('www'); | |
run(function () { | |
root(function () { | |
echo 'Hello ', link_to('World', url_for::some_action()); |
This file contains hidden or 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
{ | |
"repositories": { | |
"pateketrueke": { | |
"package": { | |
"name": "tetlphp", | |
"version": "trunk", | |
"dist": { | |
"url": "https://github.com/pateketrueke/tetlphp/zipball/master", | |
"type": "zip" | |
} |