Skip to content

Instantly share code, notes, and snippets.

View caryfitzhugh's full-sized avatar

Cary FitzHugh caryfitzhugh

View GitHub Profile
#!/usr/bin/php
<?php
# Git Prepare Commit Message Hook Script
#
# Location: <repository>/.git/hooks/prepare-commit-msg
#
# This script will automatically add the correct
# Pivotal Ticket ID to the beginning of each commit message
# When the branch ID is starts with the Pivotal Message ID.
var url = "http://thehungryhousewife.ziplist.com/webkitchen/button/add_recipe?as_partner=thehungryhousewife&url=http%3A%2F%2Fwww.thehungryhousewife.com%2F2014%2F07%2Fpeach-cobbler.html";
var page = require('webpage').create();
page.onResourceRequested = function(request) {
console.log('Request ' + JSON.stringify(request, undefined, 4));
};
page.onResourceReceived = function(response) {
console.log('Receive ' + JSON.stringify(response, undefined, 4));
};
page.open(url);
test("Test that added_recipes will toggle the detail state", function () {
// Get our recipe
var recipe = Factories.make_recipe({in_box: false});
var other_recipe = Factories.make_recipe();
// Spying -- not needed.
$(document).trigger('recipes.show_recipe', recipe);
// Now make sure that it is showing the "Save Recipe" button
starting!
allowed_hosts: fitznet41.duckdns.org:3000,assets.zlcdn.com,ziplist.com,localhostgoing!
got html!
resource: http://contentz.mkt922.com/lp/static/js/iMAWebCookie.js?4d7a0e1f-138166aefa8-df4cba773885eb54dfcebd294a039c37&h=www.pages02.net - ABORT
resource: http://assets.pinterest.com/js/pinit.js - ABORT
resource: http://fitznet41.duckdns.org:3000/assets/tmwland.css?body=1 - ABORT
resource: http://fitznet41.duckdns.org:3000/assets/ziplist-web/theme.css?body=1 - ABORT
resource: http://fitznet41.duckdns.org:3000/assets/tmwland/utils/setup_z.js?body=1 - OK
resource: http://fitznet41.duckdns.org:3000/assets/tmwland/utils/lodash.js?body=1 - OK
@caryfitzhugh
caryfitzhugh / gist:f5c9b2f5f3b7f74b6b8c
Created August 8, 2014 16:21
Recipe Page Localy Rendered
starting!
allowed_hosts: fitznet41.duckdns.org:3000,assets.zlcdn.com,ziplist.com,localhostgoing!
got html!
resource: http://contentz.mkt922.com/lp/static/js/iMAWebCookie.js?4d7a0e1f-138166aefa8-df4cba773885eb54dfcebd294a039c37&h=www.pages02.net - ABORT
resource: http://assets.pinterest.com/js/pinit.js - ABORT
resource: http://fitznet41.duckdns.org:3000/assets/tmwland.css?body=1 - ABORT
resource: http://fitznet41.duckdns.org:3000/assets/ziplist-web/theme.css?body=1 - ABORT
resource: http://fitznet41.duckdns.org:3000/assets/tmwland/utils/setup_z.js?body=1 - OK
resource: http://fitznet41.duckdns.org:3000/assets/tmwland/utils/lodash.js?body=1 - OK
/* CSS generated by http://lavishbootstrap.com */
/*! normalize.css v2.1.0 | MIT License | git.io/normalize */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
@caryfitzhugh
caryfitzhugh / gist:1287079
Created October 14, 2011 13:21
Pseudo Code For Redis Weighted Sorts
if (fieldlen > 0 ) {
if (o->type != REDIS_HASH || fieldname.len < 1) return NULL;
// Here is my new code inserted
// There is probably a better way to test for the []..
if (fieldname.buf[0] == '[' && fieldname.buf[fieldname.len] == ']') {
// First - do I need to do something with the refCount on the o above?
decrRefCount(o);
// Then I need to somehow create an robj with REDIS_ENCODING_INT
@caryfitzhugh
caryfitzhugh / gist:1595616
Created January 11, 2012 16:58
How to *really* do what I wanted in jquery
// I'm a dork of sorts, and like to make my xhr requests mime type .js in rails.
// It makes action files really easy to separate (.js files are for xhr, .html files are for html)
//
// I guess it could cause issues - maybe we should be creating an XHR/html mime type
// Regardless, it's what we do at my company... I guess b/c I wrote it.
//
// So that .js view file should return HTML. You can always execute the html if you need:
// <script> alert('this xhr response has JS!'); </script>
//
// Whereas you can't really do HTML inside JS very well.
@caryfitzhugh
caryfitzhugh / RaphaelJSShapeDrawingApp.html
Created March 11, 2012 02:37 — forked from kaylarose/RaphaelJSShapeDrawingApp.html
A Simple Vector Shape Drawing App with RaphaelJS and jQuery
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script src="http://yandex.st/raphael/1.5.2/raphael.min.js"></script>
<script>
/**
* A Simple Vector Shape Drawing App with RaphaelJS and jQuery
* copyright 2010 Kayla Rose Martin - Licensed under the MIT license
* Inspired by http://stackoverflow.com/questions/3582344/draw-a-connection-line-in-raphaeljs
**/
@caryfitzhugh
caryfitzhugh / gist:2641199
Created May 9, 2012 02:01
Inputs and outputs
Inputs:
{
"foo" => [{ start: 1, end: 10}],
"bar" => [{ start: 3, end: 6}],
"baz" => [{ start: 4, end: 5}],
"bap" => [{ start: 8, end: 9}]
]
# Would with some magic, become: