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
#!/bin/bash | |
# modified from https://gist.github.com/826961 | |
VENV=$1 | |
PROGNAME=$0 | |
if [ -z $VENV ]; then | |
echo "usage: $PROGNAME [virtualenv_path] CMDS" | |
exit 1 | |
fi | |
. ${VENV}/bin/activate | |
shift 1 |
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
#!/bin/bash | |
VENV=$1 | |
if [ -z $VENV ]; then | |
echo "usage: runinenv [virtualenv_path] CMDS" | |
exit 1 | |
fi | |
. ${VENV}/bin/activate | |
shift 1 | |
echo "Executing $@ in ${VENV}" | |
exec "$@" |
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
# Configure colors, if available. | |
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | |
c_reset='\[\e[0m\]' | |
c_user='\[\033[1;33m\]' | |
c_path='\[\e[0;33m\]' | |
c_git_clean='\[\e[0;36m\]' | |
c_git_dirty='\[\e[0;35m\]' | |
else | |
c_reset= | |
c_user= |
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 | |
class BadWords | |
{ | |
public static $words = array("4r5e", | |
"5h1t", | |
"5hit", | |
"a55", | |
"anal", | |
"anus", |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: mongodb | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the mongodb data-store | |
# Description: starts mongodb using start-stop-daemon |
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
<h1>Sign in</h1> | |
<?= $this->form('login')->toSelf('post'); ?> | |
<div class="field"> | |
<?= $this->form()->label('email_addr'); ?> | |
<?= $this->form()->textField('email_addr'); ?> | |
</div> | |
<div class="field"> | |
<?= $this->form()->label('password'); ?> | |
<?= $this->form()->passwordField('password'); ?> |
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
$s = new Savant3(); | |
$f = $s->form('login'); | |
$f->depends('email_addr', 'password'); | |
$f->addValidation('email_addr', new Form_Validation('email', 'Please enter a valid email address')); | |
$f->addValidation('pass_confirm', new Form_Validation('confirm', 'Please confirm your password', array('against' => $f->password))); | |
if ($f->isSubmit() && $f->validate()) { | |
// handle login | |
} |
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
<h1>Sign in</h1> | |
<form action="/login" method="post"> | |
<div class="field"> | |
<label for="email_addr">email_addr</label> | |
<input id="email_addr" name="email_addr" size="30" type="text" /> | |
</div> | |
<div class="field"> | |
<label for="password">password</label> | |
<input id="password" name="password" size="30" type="password" /> |