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 phone_number($sPhone){ | |
$sPhone = ereg_replace("[^0-9]",'',$sPhone); | |
if(strlen($sPhone) != 10) return(False); | |
$sArea = substr($sPhone,0,3); | |
$sPrefix = substr($sPhone,3,3); | |
$sNumber = substr($sPhone,6,4); | |
$sPhone = "(".$sArea.")".$sPrefix."-".$sNumber; | |
return($sPhone); | |
} |
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 | |
//Allows all errors and notices to be displayed. | |
error_reporting(E_ALL); | |
ini_set('display_errors', '1'); | |
?> |
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 | |
//$_ENV['SHARED_DATABASE_URL'] should be changed to your environment variable. | |
extract(parse_url($_ENV['SHARED_DATABASE_URL'])); | |
R::setup("pgsql:host=$host dbname=".substr($path,1), $user, $pass); | |
?> |
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
#Keith Connolly | |
#require ruby -v 1.9.2 or higher. | |
#Extend String because it's clean. | |
class String | |
#does the same as permutation but on a string. | |
def char_arr(&block) | |
#Split all chars into an array. | |
arr = split(//) | |
#Pick all possible arrangements of that array. |
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
fastgit () { | |
print "Adding changes and commiting to current head..." | |
git add . | |
git commit -a -m "$1" | |
print "Pushing..." | |
git push | |
if [ -z "$2" ]; | |
then | |
print "Finishing up..." | |
else |
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
override func viewDidLoad() { | |
super.viewDidLoad() | |
addPullToRefreshToWebView() | |
} | |
func addPullToRefreshToWebView(){ | |
var refreshController:UIRefreshControl = UIRefreshControl() | |
refreshController.bounds = CGRectMake(0, 50, refreshController.bounds.size.width, refreshController.bounds.size.height) // Change position of refresh view | |
refreshController.addTarget(self, action: Selector("refreshWebView:"), forControlEvents: UIControlEvents.ValueChanged) |
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 | |
echo "Operation starting..." | |
if [[ $1 == "s" || $1 == "start" ]]; then | |
echo "--Starting All Docker Containers--" | |
docker start $(docker ps -a -q) | |
echo "All Containers Started..." | |
fi |
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 | |
echo "Operating on PIO containers..." | |
if [[ $1 == "s" || $1 == "start" ]]; then | |
echo "--Starting PIO Containers--" | |
docker start piopgapp | |
docker start piopgdata | |
echo "Containers Started..." | |
fi |
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
#This works on the majority of systems including windows with powershell. | |
#Start all docker containers | |
docker start $(docker ps -a -q) | |
#Stop all docker containers | |
docker stop $(docker ps -a -q) | |
#Remove all docker containers | |
docker rm $(docker ps -a -q) |
OlderNewer