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 gt (){ | |
if [[ $# > 1 ]]; then | |
g $1 --pretty=format:'%Cblue%h%Creset - %Cred%s %Cgreen(%cr)%Cblue <%an>%Creset' ${*:2} | cat - | |
else | |
echo "Usage: gt [git_function] *" | |
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
#Make a new branch: | |
gco -b new_branch | |
#do bunch of changes | |
ga -A | |
gc -m "Made a bunch of changes" | |
#checkout master | |
gco master | |
#get the latest updates to master | |
gl | |
#Go back to new_branch or whatever you called it |
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 driv_auto_email($text) { | |
$matches = array(); | |
if (preg_match('/[A-Za-z\.\-\_]*@[A-Za-z\-\_]*\.[A-Za-z\.]*/', $text, $matches)) { | |
foreach ($matches as $match) { | |
$email = ''; | |
$chars = array(); | |
for ($i=0, $len = strlen($match); $i < $len; $i++) { |
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 wpdl(){ | |
if [[ -d ./${1} ]]; then | |
echo "Project directory exists, exiting..." | |
elif [[ $# = 1 ]]; then | |
mkdir $1 | |
cd $1 | |
curl -O http://wordpress.org/latest.zip | |
unzip latest.zip | |
rm latest.zip | |
mv wordpress/* ./ |
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
// A function to strip unit type from numbers | |
@function strip-units($number) { | |
@return $number / ($number * 0 + 1); | |
} | |
// A mixin to remify a property | |
@mixin rem($prop, $data) { | |
$len: length($data); | |
$px_list: null; |
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
$yellow-light: #FFF8DC; | |
$yellow-dark: #840; | |
$green-light: #EEE8AA; | |
$green-dark: #234600; | |
$red-light: #FFE4E1; | |
$red-dark: #8c2e0b; |
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 | |
/* | |
Plugin Name: ${PLUGIN_NAME} | |
Plugin URI: http://www.barrykooij.com/${CLASS_NAME} | |
Description: ${PLUGIN_DESC} | |
Version: 1.0.0 | |
Author: Barry Kooij | |
Author URI: http://www.barrykooij.com/ | |
*/ |
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
*.codekit | |
.htaccess | |
wp-content/uploads/ | |
wp-content/blogs.dir/ | |
wp-content/upgrade/ | |
wp-content/backup-db/ | |
wp-content/advanced-cache.php | |
wp-content/wp-cache-config.php | |
wp-content/themes/twenty* | |
sitemap.xml |
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
// jQuery Closure mode | |
(function($){ | |
// Resizing the propper way | |
var resize = function() { | |
$('element').equalise(); | |
}; | |
$(window) | |
.ready( resize ) | |
.load( resize ) |
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 /* This changes the CSV into another CSV. But merges duplicated fields. */ | |
$fh = fopen("clubexp.csv", "r"); | |
$row = 0; | |
$clubs = array(); | |
while (($data = fgetcsv($fh, 1000, ",")) !== FALSE) { | |
// ID | |
$club_id = $data[0]; | |
// Day |
OlderNewer