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 # -*- coding:utf-8 -*- | |
/** | |
* handle exceptions, errors ( convert them into ErrorException instances) , | |
* even fatal errors too via shutdown registrered function. | |
* Provide a pretty smart debug pageon demand | |
* | |
* @example |
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 | |
/** | |
* get file mimetype | |
* | |
* Tries to get mime data of the file. | |
* | |
* @param str $filepath | |
* @return str mime-type of the given file, or false if nothing found | |
*/ |
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 filename = ko.views.manager.currentView.koDoc.baseName, | |
path = ko.views.manager.currentView.koDoc.displayPath; | |
/* | |
Set this to the path of your local directory where you want to backup your files | |
*/ | |
var backupLocation = "/Users/evaisse/Library/Application Support/" | |
+ "KomodoEdit/autobackup"; |
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
/** | |
* Get and run a snippets from your toolbox. | |
* | |
* First snippet name is guess by word under your cursor or before your | |
* cursor if none selected. In our example : "fooBar" | |
* The script search a snippet named : | |
* 1. the word join with the language name (lowercase) -> "php_fooBar" | |
* 2. the snippet name with preceding joker (def "any_") -> "any_fooBar" | |
* | |
* the snippet is run if found, and nothing happen otherwise (except a nice |
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 my_exception_handler($exception) | |
{ | |
print '<pre>'; | |
print $exception; | |
print '</pre>'; |
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.*; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.*; | |
import java.lang.InterruptedException; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
import org.openqa.selenium.firefox.FirefoxProfile; |
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/sh | |
# vmstat_tool.sh | |
# vmstat parser script. Makes the information easily readable. | |
# Ensure that the number of loops and delay parameters | |
# were passed to this script | |
# examine output with : nohup vmstat_tool.sh 100 > ./vmstat.log & | |
if [ $# -ne 1 ] | |
then | |
echo "Usage: $0 count" | |
exit |
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
/** | |
* Simply encode a base js object as {a:2, d:[1,"two"], c: {foo: {bar:1}}} | |
* And returns URL encoded string : a=2&d[0]=1&d[1]=two&c[foo][bar]=1" | |
* | |
* @param {Object} object A base javascript object : {} | |
* @param {String} base Optionnal base notation, should only be used by recursion for internal work | |
* @return {String} URL encoded query string | |
*/ | |
Object.toQueryString = function (object, base) { | |
var queryString = []; |
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 will_fatal() | |
{ | |
a(); | |
} | |
function a() | |
{ |
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/sh | |
# lockfile for script | |
LOCKFILE=/var/lock/poll2build.pid | |
# check lock file | |
[ -f $LOCKFILE ] && echo "script already running @ `cat /var/lock/poll2build.pid`" && exit 0; | |
# trap for cleanup lock file | |
trap "{ rm -f $LOCKFILE; exit 255; }" EXIT INT |