Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
# install_gems.rb
# Copyright 2009 Robert Jones jones@craic.com
# Use at your own risk, no warranty, etc, etc.
# Given a file of gems from another machine, recreate the same environment
# For more information see this post:
# http://craiccomputing.blogspot.com/2009/04/installing-ruby-19-and-gems-on-machine.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/container/assets/skins/sam/container.css" />
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/container/container-min.js"></script>
<script type="text/javascript" src="http://prototypejs.org/javascripts/prototype.js"></script>
<script type="text/javascript">
function setup_tooltips() {
#!/usr/bin/env ruby
# merge_highrise_contacts.rb
# 2009 Robert Jones, Craic Computing LLC (jones@craic.com)
# Distributed under the terms of the MIT Open Source license
# This is a utility to convert a CSV dump of People and Companies from
# Highrise (http://highrisehq.com) into a mailing list suitable for a Mail Merge
# with Excel/Word or Numbers/Pages (09 version)
@craic
craic / meta_search_custom_column_sort.rb
Created June 10, 2011 17:53
This gist includes a Rails helper and controller code that lets you sort on custom columns alongside the meta-search gem search and sort features
# Helper method - place in application_helper.rb
def custom_sort_helper(path, sort_term, sort_label, search, sort_string)
uri = String.new(path)
# copy the current search terms but exclude meta_sort
search_array = Array.new
search.search_attributes.each { |key, val| (search_array << "search[#{key}]=#{val}") unless key == 'meta_sort' }
uri << '?'
@craic
craic / jquery_hide_show_tags.html
Created February 19, 2013 16:05
HTML page containing Javascript code that illustrates two approaches to hiding tag pairs on a page. See also this blog post: http://craiccomputing.blogspot.com/2013/02/jquery-snippet-to-remove-links-from-page.html
<!DOCTYPE html>
<html>
<head>
<title>Jquery Tag show / hide</title>
<style>
body {
font-family: Helvetica;
font-size:11pt;
padding:5px;
@craic
craic / tutorial_1_example_1.html
Last active December 26, 2015 14:09
Simple example of embedding a Google Map in a web page
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=eiffel+tower,+Paris,+France&amp;aq=t&amp;sll=47.613028,-122.342064&amp;sspn=0.367071,0.644073&amp;ie=UTF8&amp;hq=&amp;hnear=&amp;t=m&amp;iwloc=A&amp;ll=48.858228,2.294388&amp;spn=0.006295,0.006295&amp;output=embed"></iframe>
<br />
<small>
<a href="https://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=eiffel+tower,+Paris,+France&amp;aq=t&amp;sll=47.613028,-122.342064&amp;sspn=0.367071,0.644073&amp;ie=UTF8&amp;hq=&amp;hnear=&amp;t=m&amp;iwloc=A&amp;ll=48.858228,2.294388&amp;spn=0.006295,0.006295" style="color:#0000FF;text-align:left">View Larger Map</a>
</small>
@craic
craic / tutorial_2_example_1.html
Last active December 26, 2015 22:39
Example of code to embed a single tweet in a web page
<blockquote class="twitter-tweet">
<p>Brazil to export low-cost measles &amp; rubella vaccines to developing countries
<a href="http://t.co/moEfOssAqQ">http://t.co/moEfOssAqQ</a>
</p>
&mdash; BBC News (World) (@BBCWorld)
<a href="https://twitter.com/BBCWorld/statuses/395287088033447936">October 29, 2013</a>
</blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
@craic
craic / tutorial_2_demo_2.html
Last active December 26, 2015 22:39
Widget from Twitter to embed a twitter feed in a web page
<a class="twitter-timeline" href="https://twitter.com/BBCWorld" data-widget-id="395313647477481472">Tweets by @BBCWorld</a>
<script>!function(d,s,id){
var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
if(!d.getElementById(id)){
js=d.createElement(s);
js.id=id;
js.src=p+"://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js,fjs);
}
}(document,"script","twitter-wjs");
@craic
craic / tutorial_3_example_1.html
Last active March 10, 2017 00:13
Embed a Weather Forecast from forecast.io in a web page
<iframe id="forecast_embed" type="text/html" frameborder="0" height="245" width="100%"
src="http://forecast.io/embed/#lat=64.133753&lon=-21.879272&name=Reykjavik, Iceland&color=#00aaff&font=Helvetica&units=us">
</iframe>
@craic
craic / tutorial_3_example_1.html
Created November 1, 2013 18:31
Example of a Forecast Embed weather forecast widget from forecast.io
<iframe id="forecast_embed" type="text/html" frameborder="0" height="245" width="100%"
src="http://forecast.io/embed/#lat=69.649205&lon=18.955324&name=Tromso, Norway&color=#00aaff&font=Helvetica&units=us">
</iframe>