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
&100(1 -1 $i " bottles of beer on the wall, " $i " bottles of beer." $c10 -1 "Take one down and pass it around, " $i " bottles of beer on the wall." +1 $c10$c10) | |
"No more bottles of beer on the wall, no more bottles of beer." $c10 "Go to the store and buy some more, 99 bottles of beer on the wall."$c10$c10 |
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
RewriteEngine On | |
RewriteRule ^(.*)$ index.php?p=$1 [L,QSA] |
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
<? foreach(range(1, 10) as $i) echo $i * 2 . " "; |
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
#!/usr/bin/env php | |
<?php | |
/** | |
* Checks your GMail for unread messages and lets your keyboard LED diod blink if there are some. | |
* | |
* (c) Martin Srank (http://smasty.net) | |
* Licensed under the MIT License - http://opensource.org/licenses/mit-license | |
* Use at your own risk. Tested on Debian Squeeze. | |
*/ |
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
# ========= PS1 SETTINGS | |
# Git branch | |
git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/@\1/' | |
} | |
# Pipe code notifiation | |
bash_prompt_command() { |
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 | |
namespace Smasty\Extensions; | |
use Nette, | |
Nette\Environment; | |
/** | |
* Smart presenter factory - supports custom name conventions for presenters. |
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 | |
/** | |
* The Game of Life - a PHP simulator of the famous game. | |
* Early development state. | |
* | |
* Copyright 2011 Martin Srank (http://smasty.net) | |
* | |
* This source file is subject to the MIT license: | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
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 | |
$data = file_get_contents($argv[1]); | |
$offset = isset($argv[2]) ? $argv[2] : 0; | |
if(preg_match_all('~data:image\/png;base64,([^"]+)"~i', $data, $matches)){ | |
foreach($matches[1] as $k=>$i){ | |
$id = $k+1+$offset; | |
echo "Processing page $id..."; | |
$image = imagecreatefromstring(base64_decode($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
/** | |
* List projects based on criteria. | |
* @param action | |
* @param user | |
*/ | |
public Iterable<IProject> executeAction(ListProjectsAction action, IUser user) { | |
Iterable<IProject> items = projects.values(); | |
if(action.getParams().containsKey("filter")){ | |
Pattern pattern = Pattern.compile(Pattern.quote(action.getParam("pattern")) |
OlderNewer