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
/* | |
By Osvaldas Valutis, www.osvaldas.info | |
https://osvaldas.info/image-lightbox-responsive-touch-friendly | |
Available for use under the MIT License | |
*/ | |
;( function( $, window, document, undefined ) | |
{ | |
'use strict'; |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
// requires jQuery | |
// tested only in Chrome console dev tools | |
// use jQuerify bookmarklet if your page doesn't have jQuery: http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet | |
function batchDownload( $jquery_collection_of_a_elements, buffer_ms, random_ms, timeonly_bool ){ | |
if( $jquery_collection_of_a_elements.length < 1 ){ | |
throw "Nothing to download! Empty jQuery collection."; | |
} |
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
$.fn.equalheight = function(){ | |
var $selection = this; | |
var $groups = []; | |
while( $selection.length > 1 ){// If $selection.length is greater than 1, then it must be 2, meaning there are at least 2 equal-height divs left. This will prevent an infinite loop if there is an equal-height div without a partner equal-height div. | |
// Find an equal-height group. | |
$groups.push( $selection.eq(0).siblings('.equal-height').addBack() ); | |
// Reduce selection by the latest equal-height group. | |
$selection = $selection.not( $groups[ $groups.length - 1 ] ); | |
// Drop groups that only have 1 element - it doesn't make any sense to have a lone equal-height element. |
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
terminus wp "search-replace 'find' 'replace' --dry-run" --site=mysite --env=dev|test|live |
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
echo "alias www='cd ~/Desktop/www;clear;pwd;ls -a'" >> ~/.bash_profile |
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
# http://stackoverflow.com/questions/9557646/php-mkdir-permissions-denied-mac | |
$processUser = posix_getpwuid(posix_geteuid()); | |
echo($processUser['name']); |
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
// https://github.com/mikebranski/jquery-nospam | |
// implementation | |
$(function(){ | |
function reverse(s){ | |
return s.split("").reverse().join(""); | |
} | |
var tld = addr.substring( addr.lastIndexOf('.') + 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
.DS_Store | |
Thumbs.db | |
dwsync.xm | |
_notes/ | |
*.svn | |
*.swo | |
*.swp | |
~ | |
*~ | |
~* |
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
/* put the current year in the footer of your website */ | |
$("#footer .year").text(" " + ( new Date() ).getFullYear() ); | |
/* ^ this space will come after the copyright symbol before the year. Notice how the HTML is laid out in mytemplate.html. */ |