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
<HTML> | |
<HEAD> | |
<TITLE>Volume Discount</TITLE> | |
<SCRIPT LANGUAGE = "JavaScript"> | |
// A program to tell a customer what volume discount they can expect. | |
var numberOfGiftBoxes = window.prompt('Please enter now many boxes you are purchasing.', ''); | |
var boxes = parseFloat(numberOfGiftBoxes); | |
if (isNaN(boxes)) |
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
Function Explode(Separator, S : String) : TStringList; | |
Var | |
PrevPos, x : Integer; | |
strLen, | |
delimLen : Integer; | |
Begin | |
If (Separator = '') Then | |
Raise Exception.Create('Empty separator'); | |
Result := TStringList.Create(); |
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 Protec\Stdlib; | |
use \Zend\EventManager\EventManagerInterface; | |
use \Zend\ServiceManager\ServiceLocatorAwareInterface; | |
trait EventManagerAwareTrait | |
{ | |
protected $event_manager; |
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 | |
// Require authentication password | |
require_once("auth.php"); | |
class TS3Radio | |
{ | |
protected $_clientHost; | |
protected $_clientPort; |
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
vagrant@vagrant:/var/www$ cat index.sf | |
import io; | |
io.print("Hello, world!\n"); | |
vagrant@vagrant:/var/www$ saffire exec index.sf | |
vagrant@vagrant:/var/www$ |
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
/usr/share/saffire/modules | |
/usr/share/saffire/modules/sfl | |
/usr/share/saffire/modules/sfl/io.sf | |
/usr/share/saffire/modules/sfl/saffire.sf | |
/usr/share/saffire/modules/Framework.sf | |
/usr/share/saffire/modules/Framework | |
/usr/share/saffire/modules/Framework/View.sf | |
/usr/share/saffire/modules/Framework/Http.sf |
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
| (• ◡•)|/ \(❍ᴥ❍ʋ) Adventure Time! |
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 | |
$dsn = 'mysql:host=trolololol;dbname=WOOT!'; | |
$username = 'yeah'; | |
$password = 'MMMMM hmm'; | |
$pdo = new PDO($dsn, $username, $password); | |
$sql = 'SELECT `date`, SUM(`Commited`) AS committedSum FROM StorageUsedByVm GROUP BY `date`'; | |
$stmt = $pdo->query($sql); |
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 | |
# Convert 'http://github.com/user/repo' remotes to 'git://github.coim/user/repo'. | |
for GIT_DIR in $(find . -type d -name '.git'); do | |
export GIT_DIR | |
CURRENT_URL=$(git config --get remote.origin.url); | |
NEW_URL=$(echo $CURRENT_URL | sed 's/^http:/git:/'); | |
NEW_URL=$(echo $NEW_URL | sed 's/^https:/git:/'); | |
if [ "$CURRENT_URL" != "$NEW_URL" ]; then |
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 | |
# PR been merged on github? This will checkout $1 || develop, git pull, and then delete the branch you were on. | |
# Thanks http://stackoverflow.com/a/1593487/328817 | |
branch_name="$(git symbolic-ref HEAD 2>/dev/null)" || branch_name="(unnamed branch)"; # detached HEAD | |
branch_name=${branch_name##refs/heads/}; | |
if [ "$branch_name" = "develop" ] || [ "$branch_name" = "master" ] | |
then |
OlderNewer