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
/** | |
* Useful functions | |
*/ | |
var Tools = function() {}; | |
/** | |
* Checks a value is not null or undefined | |
* @param test | |
* @return {Boolean} | |
*/ |
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 | |
// | |
// Edit these bits | |
// | |
$bundleFileName = __DIR__.'/_bundle.js'; | |
$devMode = true; | |
$files = 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
#!/bin/bash | |
# This bit is by Brian Campbell | |
# Source: http://stackoverflow.com/questions/699576/validating-parameters-to-a-bash-script | |
die () { | |
echo >&2 "$@" | |
exit 1 | |
} | |
[ "$#" -eq 1 ] || die "This shit takes one arguement user[:group]" |
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 | |
alias ll='ls -alph' | |
alias tarzip='tar -czfv' | |
alias untarzip='tar -xzfv' | |
sshagent () { eval `ssh-agent -s` && ssh-add; }; | |
alias git-commit='git commit -S -m' | |
alias git-log='git log --show-signature' | |
alias git-tag='git tag -s' |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "precise64" | |
# The url from where the 'config.vm.box' box will be fetched if it | |
# doesn't already exist on the user's system. |
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 the given variable from $_REQUEST or from the url | |
* @param string $variableName | |
* @param mixed $default | |
* @return mixed|null | |
*/ | |
function getParam($variableName, $default = null) { | |
// Was the variable actually part of the request | |
if(array_key_exists($variableName, $_REQUEST)) |
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 | |
# Spinner Source: http://it.toolbox.com/blogs/locutus/bash-bits-nibbles-and-bytes-a-rotating-cursor-while-you-wait-22867 | |
# Parallel process Source: http://stackoverflow.com/questions/6384013/run-bash-commands-in-parallel-track-results-and-count#6384467 | |
# Hide job status source: http://superuser.com/questions/377775/how-do-i-keep-background-jobs-from-telling-me-theyre-done | |
# Spin the spinner. Must be called repeatedly to animate | |
function spin() { | |
case $toggle | |
in |
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
# Credit to sehe | |
# url: http://stackoverflow.com/questions/5559321/fetch-all-in-a-git-bare-repository-doesnt-synchronize-local-branches-to-the#5559586 | |
dir=$1 | |
if [ "$dir" == "" ] ; then | |
echo "What are we forking?" | |
read dir | |
fi | |
url=https://github.com/opscode-cookbooks/$dir | |
git init --bare $dir.git |
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 | |
class SomeClass { | |
const FIELD_MISSING = 'Missing'; | |
const FIELD_INVALID = 'Invalid'; | |
/** | |
* Checks each field for a validate function for each field of the object and runs it | |
* Override to change this functionality |
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 | |
cat /etc/*release | |
grep 'PermitRootLogin\|PasswordAuthentication' /etc/ssh/sshd_config | |
sudo /etc/init.d/denyhosts status | |
sudo /etc/init.d/fail2ban status | |
sudo grep '/home' /etc/passwd | cut -d : -f 1 | awk '{ sudo system("sudo passwd -S " $0) }' | grep -C 9999 ' P \| set\,' --color | |
echo "select Host, User, Password from mysql.user; select ''; show variables like 'version';" | mysql -uroot -p | |
/usr/sbin/apachectl -v | |
php -v |
OlderNewer