Skip to content

Instantly share code, notes, and snippets.

View pamelafox's full-sized avatar

Pamela Fox pamelafox

View GitHub Profile
@pamelafox
pamelafox / restaurants.xml
Created June 27, 2012 00:07
Sample XML: Seattle Restaurants
<?xml version="1.0"?>
<restaurants>
<restaurant name="Pan Africa Market" address="1521 1st Ave, Seattle, WA" lat="47.608940" lng="-122.340141" type="sitdown"/>
<restaurant name="Buddha Thai & Bar" address="2222 2nd Ave, Seattle, WA" lat="47.613590" lng="-122.344391" type="bar"/>
<restaurant name="The Melting Pot" address="14 Mercer St, Seattle, WA" lat="47.624561" lng="-122.356445" type="sitdown"/>
<restaurant name="Ipanema Grill" address="1225 1st Ave, Seattle, WA" lat="47.606365" lng="-122.337654" type="sitdown"/>
<restaurant name="Sake House" address="2230 1st Ave, Seattle, WA" lat="47.612823" lng="-122.345673" type="bar"/>
<restaurant name="Crab Pot" address="1301 Alaskan Way, Seattle, WA" lat="47.605961" lng="-122.340363" type="sitdown"/>
<restaurant name="Mama's Mexican Kitchen" address="2234 2nd Ave, Seattle, WA" lat="47.613976" lng="-122.345467" type="bar"/>
<restaurant name="Wingdome" address="1416 E Olive Way, Seattle, WA" lat="47.617214" lng="-122.326584" type="bar"/>
@pamelafox
pamelafox / nutrition.xml
Created June 27, 2012 00:03
Sample XML: Foods
<?xml version="1.0"?>
<nutrition>
<daily-values>
<total-fat units="g">65</total-fat>
<saturated-fat units="g">20</saturated-fat>
<cholesterol units="mg">300</cholesterol>
<sodium units="mg">2400</sodium>
<carb units="g">300</carb>
<fiber units="g">25</fiber>
<protein units="g">50</protein>
@pamelafox
pamelafox / idiomatic_JA.md
Created June 18, 2012 23:22
Idiomatic.JS, japanese translation from Mashashi

#慣用的なJavaScript, 矛盾しないコードの書き方

これは現在使っているドキュメントです。私達が使っているコードを向上させるためのアイディアはいつでも歓迎です。意見を述べるには、fork, clone, branch, commit, push, pull requestなどをしてください。

@pamelafox
pamelafox / hearty.user.js
Created June 14, 2012 05:00
TxJS Hearty User Extension
// Also requires jQuery pasted in the top in Chrome
function loadHearts() {
$('#speakers').hide();
$('#scene').hide();
$('#schedule td').each(function() {
var $talkCell = $(this);
var rateLink = $talkCell.find('a');
if (!rateLink.length) return;
@pamelafox
pamelafox / yahoogeocoder.py
Created June 7, 2012 18:49
YahooGeocoder
import urllib
import settings
try:
import json
except ImportError:
import simplejson as json
class YahooException(Exception):
pass
@pamelafox
pamelafox / render_handlebars.py
Created May 30, 2012 06:22
Handlebars Folder Renderer Script
import os
input_path = 'application/templates'
output_path = 'application/static/js/templates'
os.system('mkdir %s' % output_path)
dir_list = os.listdir(input_path)
for file_name in dir_list:
if file_name.endswith('.handlebars'):
cmd = 'handlebars %s/%s -f %s/%s' % (input_path, file_name, output_path, file_name.replace('handlebars', 'js'))
@pamelafox
pamelafox / gist:2716823
Created May 17, 2012 05:56
JS Errors and Causes
These arent always the causes, just in the cases I saw them.
Unexpected {
Cause: mismatched curly braces, count your braces
Unexpected token .
Cause: var buttonDiv.bla = 4
SyntaxError: Unexpected string
Cause: var bla = bla + ' hi ' ' you'
@pamelafox
pamelafox / editorhack.diff
Created May 15, 2012 22:11
EditorManager + CommandManager
diff --git a/src/brackets.js b/src/brackets.js
index 39e30b2..cb20367 100644
--- a/src/brackets.js
+++ b/src/brackets.js
@@ -199,7 +199,8 @@ define(function (require, exports, module) {
//{"Ctrl-X": Commands.EDIT_CUT},
//{"Ctrl-C": Commands.EDIT_COPY},
//{"Ctrl-V": Commands.EDIT_PASTE},
-
+ {"Ctrl-I": Commands.SHOW_OTHER_STUFF},
@pamelafox
pamelafox / IframeViewer.js
Created May 15, 2012 21:50
IframeViewer for Brackets
/*
* Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
@pamelafox
pamelafox / CameraLauncher.java
Created May 15, 2012 15:06
PhoneGap Camera.java (Hacked up)
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0