Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Running this script via ./smartcommit.sh provides a fast way
# to selectively include files in an 'svn commit.'
# The script can be used as follows:
#
# 1. Enter ./smartcommit.sh at the command line from within the project's directory
# 1. A temporary file containing an 'svn status' list is opened in Vim
# 2. Remove any lines specifiying files you DO NOT want to commit
# 3. Enter :wq in command mode to save and quit the temporary file
@mdb
mdb / gist:820540
Created February 10, 2011 13:57
fc_make_local_frags.sh
#!/bin/bash
# This script:
# 1) makes a directory at $new_directory_loc.
# By default, wordpress/wp-content/ctv/local.
# 2) copies files from $files_to_copy $new_directory_loc.
# By default, from wordpress/wp-content/ctv/* to wordpress/wp-content/ctv/local/
# 3) replaces all instances of $find_css with $replace_css in the files copied to
# $new_directory. By default, the relative css paths are replaced with complete
# css paths pointing to our local dev server.
@mdb
mdb / Google Calendar Atom Reader
Created April 10, 2011 20:51
Grabs And Displays a Public Google Calendar's Atom Feed
<?php
//Used to fetch Google Calendar Atom feed
function getShortCalFeed($feed_url) {
$feed_content = file_get_contents($feed_url);
$feed = new SimpleXMLElement($feed_content);
$namespaces = $feed->getNamespaces(true);
//set max entries to loop through and a count var
$maxLoop = 4;
@mdb
mdb / gist:1037772
Created June 21, 2011 12:39 — forked from gsf/gist:1036573
phlapi
// possible ideal for handling sanitation districts
var address = $('#addressInput').val();
phl(address, 'http://some.api.url' function(districts) {
$.each(districts, function(index, value) {
$('ul').append('<li>'+value+'</li>');
});
});
<deviceName>&lt;p&gt;Blah2&lt;/p&gt;</deviceName>
!= partial('partials/carousel', { entities: fast.results.slice(0, 5), title: 'Recommended For You', showDoubleWide: true })
!= partial('partials/carousel', { entities: fast.results.slice(5, 10), title: 'In Your Watchlist' })
h2 Navigation
ul
li: a(href="/recommendations") Recommendations
li: a(href="/genres") Genres
li: a(href="/content/series") All series
li: a(href="/content/movies") All movies
Then /^debug$/ do
debugger;1
end
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
require 'uri'
require 'cgi'
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
<ul class="thumbnails standard">
<li class="item">
<a class="thumbnail standard" href="">
<img src="http://dl.dropbox.com/u/22302/2_XTV_1_Home_03.jpg">
<b class="icon play">Play</b>
<span class="air-date">3/20/11</span>
<span class="net-logo">
<img src="" alt="Network logo" />
</span>
</a>
<div id="contests-cycle">
<ul>
<!-- an example of a linked image in the slideshow: -->
<li>
<a href=""><img src=""/></a>
</li>
<!-- an example of an iframe in the slideshow: -->
<li>
<iframe src="" width="" height="" frameborder="0"></iframe>
</li>