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 | |
/** | |
* When you travel in a group and, for practical reasons, some people pay | |
* expenses for the whole group (hotel rooms, train tickets, ...), this class | |
* will help you to sort out who gets how much money back in the end. | |
*/ | |
namespace foo; | |
use Exception; |
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
import java.io.File; | |
import javax.xml.XMLConstants; | |
import javax.xml.transform.Source; | |
import javax.xml.transform.stream.StreamSource; | |
import javax.xml.validation.*; | |
import org.xml.sax.SAXException; | |
import com.sun.org.apache.xerces.internal.util.XMLCatalogResolver; | |
public class SchemaValidator | |
{ |
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
#!/bin/bash | |
## | |
# phermin -- PHP Version Manager | |
# | |
# *** USE AT OWN RISK! *** | |
# | |
# Usage: phermin [<task>] [<args>] | |
# Author: Marc Ermshaus <marc@ermshaus.org> | |
# License: MIT <http://opensource.org/licenses/mit-license.php> |
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
obfuscate |
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 // File: org.ermshaus.Counter.bundle.php | |
namespace org\ermshaus; | |
use Exception; | |
/** | |
* | |
*/ | |
class CounterException extends Exception |
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
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} -s [OR] | |
RewriteCond %{REQUEST_FILENAME} -l [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^.*$ - [NC,L] | |
RewriteRule ^.*$ index.php [NC,L] |
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 | |
/** | |
* Tries to find the first intersection of functions $f and $g within a given | |
* interval | |
* | |
* $discardExceptions allows $f and $g to reject/skip certain values (e. g. | |
* because of division by zero) by throwing an exception without having to stop | |
* the whole calculation. | |
* |
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
#!/bin/bash | |
# marc-watchphp -- Executes a PHP script file when its content changes. | |
# | |
# Usage: $ marc-watchphp <file> | |
# | |
# Working directory MUST be file's directory. Press Ctrl-C to stop. | |
inotifywait -q -m -e close_write,moved_to --format %e/%f . | | |
while IFS=/ read -r events file; do |
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 | |
// **************************************************************** | |
// Please note: An improved version of the class has been added to: | |
// | |
// https://github.com/mermshaus/kaloa-filesystem | |
// | |
// The code in this Gist is deprecated. | |
// **************************************************************** |