Skip to content

Instantly share code, notes, and snippets.

/**
* Takes a jQuery collection and wraps each 'groupSize' items with 'wrapHtml'
* Example: $('#Example span').wrapInGroups('<div/>', 4);
* Will wrap every 4 span's inside #Example with a div
* See for yourself: http://jsfiddle.net/M9ZFh/
* Author: iMoses (imoses.g@gmail.com)
*/
(function($) {
$.fn.wrapInGroups = function(wrapHtml, groupSize) {
var selector = this.selector;
@adamturtle
adamturtle / gist:8797154
Last active August 29, 2015 13:56
Child theme comment
/*
Theme Name: Child Theme {Child Theme of Worpress Foundation}
Theme URI: http://320press.com/wpfoundation
Description: A bones/Zurb foundation based wordpress theme.
Version: 1.0
Template: wordpress-foundation
*/
@import url("../wordpress-foundation/style.css");
/*
Theme Name: Example Child Theme Name
Theme URI: http://child-theme-homepage.tld
Description: A description of your child theme.
Author: Child Theme Author Name
Author URI: http://child-theme-author-homepage.tld
Version: 1.0
Tags: translation-ready, ...
#!/usr/bin/env bash
#
# simple recursive search and replace string in files
# setup: alias replace='~/replace.sh'
# notes: you will need to escape special chars! eg: replace '\/dir1' '\/dir2' .
# usage: replace <oldstring> <newstring> <path> <depth>
# examples:
# replace "([^\s]+.php)" "\/\1" .
# replace "\"\/([^\/]+.php)" "\"\/dir\/\1" .
@adamturtle
adamturtle / 0_reuse_code.js
Created September 27, 2013 15:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console