Skip to content

Instantly share code, notes, and snippets.

View cranderveldt's full-sized avatar

Trevor cranderveldt

View GitHub Profile
@cranderveldt
cranderveldt / partners-more-if-statement
Created April 27, 2012 17:38
Partners More if statement
{exp:channel:entries channel="partners" disable="member_data|categories|pagination" status="open"}
{if partner_logo == ""}
<li class="clearfix">
<a href="{partner_link}"><h4>{title}</h4></a>
<p>{partners_summary}</p>
</li>
{sv_edit_me}
{/if}
{/exp:channel:entries}
@cranderveldt
cranderveldt / Sample Lightbox
Created June 4, 2012 20:12
Sample Lightbox
<a href="#" data-reveal-id="sample-lightbox">Click for lightbox</a>
<div id="sample-lightbox" class="reveal-modal">
Lightbox content
<a class="close-reveal-modal">&#215;</a>
</div>
@cranderveldt
cranderveldt / mysqld_output.txt
Created July 7, 2012 22:41
Output from $ mysqld
120707 18:31:16 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
120707 18:31:16 InnoDB: The InnoDB memory heap is disabled
120707 18:31:16 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120707 18:31:16 InnoDB: Compressed tables use zlib 1.2.5
120707 18:31:16 InnoDB: Initializing buffer pool, size = 128.0M
120707 18:31:16 InnoDB: Completed initialization of buffer pool
InnoDB: Unable to lock ./ibdata1, error: 35
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
120707 18:31:16 InnoDB: Retrying to lock the first data file
@cranderveldt
cranderveldt / mysqld_output2.txt
Created July 8, 2012 03:01
mysql commandline output
//Output of $ ps aux | grep mysql
Username 24175 0.0 0.0 2653808 1280 ?? S 3Jun12 8:15.99 /usr/local/Cellar/mysql/5.5.24/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.5.24 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/5.5.24/lib/plugin --log-error=/usr/local/var/mysql/Old-Computer-Name.local.err --pid-file=/usr/local/var/mysql/Old-Computer-Name.local.pid
Username 24104 0.0 0.0 2435488 0 ?? S 3Jun12 0:00.03 /bin/sh /usr/local/Cellar/mysql/5.5.24/bin/mysqld_safe --datadir=/usr/local/var/mysql --pid-file=/usr/local/var/mysql/Old-Computer-Name.local.pid
Username 20063 0.0 0.0 2434892 540 s002 S+ 10:55PM 0:00.00 grep mysql
Username 19994 0.0 0.7 2613272 30384 ?? S 10:54PM 0:00.10 /usr/local/Cellar/mysql/5.5.24/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.5.24 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/5.5.24/lib/plugin --log-error=/usr/local/var/mysql/New-Computer-Name.l
@cranderveldt
cranderveldt / mixin
Created July 23, 2012 20:50
gradient mixin
@mixin gradient($top, $bottom, $fallback) {
background-color: $bottom;
background-position: 0 0;
background-repeat: repeat-x;
background-image: url($fallback);
background-image: -webkit-gradient(linear, left top, left bottom, from($top), to($bottom)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient(top, $top, $bottom); /* Chrome 10+, Saf5.1+, iOS 5+ */
background-image: -moz-linear-gradient(top, $top, $bottom); /* Firefox 3.6-15 */
background-image: -o-linear-gradient(top, $top, $bottom); /* Opera 11.10+ */
background-image: linear-gradient(to bottom, $top, $bottom); /* Firefox 16+ */
@cranderveldt
cranderveldt / crazyjson
Created July 24, 2012 19:13
Some crazy EE JSON
var jStories = {exp:json:entries channel="stories|storiesdev" status="open|Featured" disable="member_data|pagination"};
var entryIDReverseLookup = {};
for(var i = 0; i < jStories.length; i++) {
entryIDReverseLookup['ID_' + jStories[i].entry_id] = i;
}
for(var i = 0; i < jStories.length; i++) {
profileInfo['title_' + jStories[i].entry_id] = jStories[i].title;
profileInfo['name_' + jStories[i].entry_id] = jStories[i].story_motto;
profileInfo['image_' + jStories[i].entry_id] = jStories[i].story_cover;
profileInfo['type_' + jStories[i].entry_id] = jStories[i].story_type;
@cranderveldt
cranderveldt / ss-standard-trunc.css
Created July 31, 2012 16:12
Truncated Symbolset CSS
.ss-cursor:before{content:''}.ss-crosshair:before{content:'⌖'}.ss-search:before{content:'
@cranderveldt
cranderveldt / javascript-random-entries
Created September 14, 2012 20:16
javascript for an entry template that looks at other entries in the same channel and determines how similar each entry is based on how many categories they share, then it puts all the entries above a defined threshold in an array, randomizes it, and print
<div id="stories-related">
<script>
eeGlobal.jsonEntries = {exp:json:entries channel="stories" category="{embed:cat}" dynamic="no" disable="custom_fields|member_data|pagination"}
eeGlobal.categoriesByEntry = {};
eeGlobal.relatedStories = [];
eeGlobal.randomStories = [];
var threshold = 2; //This is the number of categories two entries have to share before they are considered "related"
{exp:channel:entries channel="stories" dynamic="no" category="{embed:cat}" disable="member_data|pagination"}
eeGlobal.categoriesByEntry['{entry_id}'] = '';{categories show_group="2"}
eeGlobal.categoriesByEntry['{entry_id}'] = eeGlobal.categoriesByEntry['{entry_id}'] + '|' + ('{category_id}');{/categories}
@cranderveldt
cranderveldt / html5shiv
Created September 26, 2012 18:58
HTML5 Shiv
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
@cranderveldt
cranderveldt / grunt.js
Created November 15, 2012 20:34
Example Grunt File
// This is the main application configuration file. It is a Grunt
// configuration file, which you can learn more about here:
// https://github.com/cowboy/grunt/blob/master/docs/configuring.md
//
// Some samples which provided inspiration
// http://code.google.com/p/jquery-ui/source/browse/tags/latest/grunt.js?r=4127
// https://github.com/tbranyen/backbone-boilerplate/blob/master/grunt.js
module.exports = function(grunt) {