View equalise-usage.js
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 ) |
View csv-merge.php
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 |
View functions.php
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
add_action( 'show_user_profile', 'my_show_extra_profile_fields' ); | |
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' ); | |
function my_show_extra_profile_fields( $user ) { ?> | |
<h3>Extra profile information</h3> | |
<table class="form-table"> |
View Git examples
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 |
View SH: wordpress_download.sh
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/* ./ |
View wp-seo-filters.php
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 | |
// Remove Canonical Link Added By Yoast WordPress SEO Plugin | |
function at_remove_dup_canonical_link() { | |
return false; | |
} | |
add_filter( 'wpseo_canonical', 'at_remove_dup_canonical_link' ); | |
function wpseo_attachment_canonical_parent( $canonical ) { |
View ACF: Location > Static Google Map
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 | |
$location = get_sub_field('location'); | |
if( !empty($location) ): | |
?> | |
<img src="http://maps.googleapis.com/maps/api/staticmap?center=<?php echo $location['lat']; ?>,<?php echo $location['lng']; ?>&zoom=15&format=png&sensor=false&size=640x480&maptype=roadmap&visual_refresh=true&style=visibility:off&style=feature:road|element:geometry|visibility:simplified|color:0xefecec&style=feature:landscape|element:geometry|visibility:simplified|color:0xffffff&style=element:labels|visibility:on&markers=color:black|<?php echo $location['lat']; ?>,<?php echo $location['lng']; ?>"/> | |
<?php endif; ?> |
View schotter.pde
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
// Support Classes | |
class Vec3f { | |
float x, y, z; | |
Vec3f(float x, float y, float z) { | |
this.x = x; | |
this.y = y; | |
this.z = z; | |
} | |
void scale(float scale) { | |
this.x *= scale; |
View git-pull-yosemite-fix
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
// Open: | |
/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-pull | |
// Replace line 11 & 12 | |
. git-sh-setup | |
. git-sh-i18n | |
// With this: | |
. /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-sh-setup | |
. /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-sh-i18n |
View wp_custom_title_placeholder_text.php
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 | |
/* | |
replacing the default "Enter title here" placeholder text in the title input box | |
with something more descriptive can be helpful for custom post types | |
place this code in your theme's functions.php or relevant file | |
source: http://flashingcursor.com/wordpress/change-the-enter-title-here-text-in-wordpress-963 | |
*/ |
OlderNewer