Skip to content

Instantly share code, notes, and snippets.

@shannonmoeller
shannonmoeller / sprinkle.js
Last active August 29, 2015 14:09
sprinkle
var a = [
'a', 'aa', 'aaa', 'aaaa', 'aaaaa',
'b', 'bb', 'bbb', 'bbbb', 'bbbbb',
'c', 'cc', 'ccc', 'cccc', 'ccccc'
];
var b = [
'Z', 'ZZ', 'ZZZ'
];
@airways
airways / QUERY_PARAM.md
Created July 19, 2011 22:24
ExpressionEngine: new QUERY_PARAM protocol that always works

QUERY_PARAM Protocol

This is a simple technique which should work on ALL hosts to allow ExpressionEngine to handle URLs without index.php in them. Hopefully EllisLab will add this as a built-in option soon.

IJR

@adrienne
adrienne / gist:2888431
Created June 7, 2012 12:01
stash events filtered by day of the week
{!-- Controller --}
{exp:channel:entries channel="events" dynamic="off" show_future_entries="yes" order_by="entry_date" sort="asc" }
{!-- group into lists by day of the week --}
{exp:stash:append_list name="events_list" context="{entry_date format='%D'}" }
{stash:entry}
<li><a href="{page_url}">{title}</a> {entry_date format="%d/%m/%y"}</li>
{/stash:entry}
{/exp:stash:append_list}
{/exp:channel:entries}
@wjnerdery
wjnerdery / scm_info.sh
Created June 22, 2012 16:53 — forked from claussni/gist:894310
Source Control Management Bash Prompt Highlighting
##
## SCM info
##
scm_info() {
local bzr_info=`bzr revno --tree 2> /dev/null`
if [ ${bzr_info} ]; then
if [ "$(bzr st -S)" ]; then
local bzr_color='\033[1;31m'
else
local bzr_color='\033[1;36m'
<?php
public function settings()
{
$this->EE->cp->set_right_nav(array(
'&larr; Back to Schemas' => $this->cp_url('schemas'),
));
$fields = array(
'settings' => array(
@hapticdata
hapticdata / bubbled-console.js
Created September 6, 2012 02:32
bubble console methods from nested iframes into root window.console
//##console.log bubble for nested iframes
//##by [Kyle Phillips](http://haptic-data.com)
//find each iframe recursively and bubble its logs up to the current window.console
(function( d, w ){
function bubble( doc, win, msg ){
Array.prototype.forEach.call(doc.getElementsByTagName('iframe'), function( frame ){
if( !sameOrigin(frame.src) || !frame.contentWindow || !frame.contentWindow.console ){
w.console.log('console of iframe ', frame.src, ' is unreachable');
return;
}
@GDmac
GDmac / gist:3667859
Created September 7, 2012 17:12
EE Preload replace double trick

main template

{preload_replace:preload_trick="preload_replace"}
{embed="group/template" preload='{{preload_trick}:pre_url_title="special"}'}

embedded template

if called via embed you can override the preload_replace once more.
It will insert the embed-variable and parse it early.

{embed:preload}
{if segment_3==""}{preload_replace:pre_url_title="fallback"}{/if}

@jeromecoupe
jeromecoupe / gist:3880163
Created October 12, 2012 16:40
Custom pagination with {exp:stash:get_list} and filtering
{!-- Wrapper template --}
{embed="wrappers/page_full_width"}
{!-- Meta data --}
{exp:stash:set name="meta_title"}Our projects{/exp:stash:set}
{exp:stash:set name="meta_description"}Projects of the International Polar Foundation{/exp:stash:set}
{!-- Navigation --}
{exp:stash:set name="nav_current"}projects{/exp:stash:set}
@bryanburgers
bryanburgers / template.html
Created May 14, 2015 02:30
Group adjacent blocks of the same type together.
{!--
> Awesome. Just had an Ah-ha! moment. Build small blocks, then add
> multiple Block fields to a channel with specific blocks in.
-- @JayHealy, https://twitter.com/JayHealey/status/598668322301837312
--}
{cf_page_content}
@ludofleury
ludofleury / getset.sublime-snippet
Created February 15, 2013 02:25
PHP (Symfony) oriented getter-setter snippet for Sublime Text
<snippet>
<content><![CDATA[
/**
* Get $1
*
* @return ${2:[type]} \$$1
*/
public function get${1/(.*)/\u$1/}()
{
return \$this->${1:$SELECTION};