Skip to content

Instantly share code, notes, and snippets.

<<<<<<< HEAD
<td class="drinks-sub"><label for="flyout-19"><input type="checkbox" id="flyout-19" name="category" value="non-alcoholic" /> Non-Alcoholic</label></td>
=======
<td class="drinks-sub"><label for="flyout-19"><input type="checkbox" id="flyout-19" name="category" value="homebrewing" /> Homebrewing</label></td>
>>>>>>> checking in the latest staging templates.
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><label for="flyout-20"><input type="checkbox" id="flyout-20" name="category" value="cheese" /> Cheese</label></td>
@nataliepo
nataliepo / mt_for_sample.html
Created February 21, 2011 20:56
i always forget the syntax for mt templates using the <mt:for> tag.
<ul class="gallery">
<mt:setvarblock name="num_assets"><$MTNumAssets$></mt:setvarblock>
<mt:setvarblock name="num_assets"><mt:var name="num_assets" op="++"></mt:setvarblock>
<!-- num assets = <mt:var name="num_assets"> -->
<MTIfHasAsset placement="1">
<!-- Has a numbered asset! -->
<mt:for var="i" from="1" to="$num_assets" increment="1">
@nataliepo
nataliepo / gist:1054965
Created June 29, 2011 21:03
a webserver in one line
cd /home/somedir
$ python -m SimpleHTTPServer
@nataliepo
nataliepo / gallery.json
Created March 26, 2012 17:23
One full gallery
@nataliepo
nataliepo / verbatim.tmpl
Created March 28, 2012 18:53
tornado template verbatim
{%!
<p>THIS IS A VERBATIM TORNADO TEMPLATE BLOCK</p>
%}
@nataliepo
nataliepo / scrolly.js
Created April 27, 2012 18:07
Jquery - scroll to a div.
// if we have an anchor in the url, scroll there.
var parts = window.location.href.split("#");
if (parts.length > 1) {
var target_id = parts[1];
$('html, body').animate({scrollTop:$('#' + target_id).offset().top}, 500);
}
@nataliepo
nataliepo / tornado_cheats.js
Created May 31, 2012 23:29
Tornado/JQuery Tmpl Cheatsheets
// loop over an array, spit out each of its deck values in safe-html.
{{!each recent_galleries}}
{{!html $value.deck}}
{{!/each}}
// show the raw html code of a jquery variable (good for refreshing html previews)
{{!html body}}
@nataliepo
nataliepo / ajax-DELETE.js
Created June 26, 2012 20:55
ajax-DELETEing an object from a tornado endpoint
var api_url = $.fn.adminURL() + '/gallery/remove/' +
gallery_id + '.json';
var values = {};
$.ajax({
url: api_url,
// contentType: "application/json",
//data: JSON.stringify(values),
data: $.param(values),
ARTICLE_SECTIONS = [
{
'name': 'report',
'description': 'Reports'
},
{
'name': 'feature',
'description': 'Features'
},
{
APP_NAME = 'Local Demo'
DROPBOX_SETTINGS = {
# 29pco -- DEV KEYS
'app_key': 'key',
'app_secret': 'secret',
'access_type': 'app_folder',
'folder': '',
'app_name': '',