Skip to content

Instantly share code, notes, and snippets.

View jjulian's full-sized avatar

Jonathan Julian jjulian

  • MD
  • 02:17 (UTC -04:00)
View GitHub Profile
@jjulian
jjulian / hide-button.html
Created November 2, 2011 20:35
Shortmail widget: you are going to use your own link, so hide the button
<script src="http://shortmail.com/widgets/compose-widget.js?v=1"></script>
<script>
Shortmail.ComposeWidget({
screenName: '[email protected]'
});
$(document).ready(function() {
// hide the button
$('button.shortmail-me').hide();
});
</script>
@jjulian
jjulian / example.erb
Created February 18, 2012 16:44
Running Ruby under Apache like PHP, using cgi - http://stackoverflow.com/a/1901772/231245
<% header "Content-Type" => "text/html" %>
<h1>Let's run some ruby code: <%= rand %></h1>
@jjulian
jjulian / apache.conf
Created February 23, 2012 03:38
Apache rewrite rules to show a maintenance page
# Capistrano-style: if maintenance.html exists, it will be served for any request
# other than style and images. Use status code 503 to tell crawlers to come back later.
ErrorDocument 503 /system/maintenance.html
RewriteEngine On
RewriteCond %{REQUEST_URI} !\.(css|gif|jpg|png)$
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ - [redirect=503,last]
https://accounts.google.com/o/openid2/auth?openid.assoc_handle=AMlYA9UJBozPiJiAA8zy3HG1MgQ8g8y3nqPVtMjdoOXutcKd3buWSITu
openid.ax.if_available=ext0,ext1,ext3,ext4,ext7
openid.ax.mode=fetch_request
openid.ax.required=ext2,ext5,ext6,ext8
openid.ax.type.ext0=http://axschema.org/namePerson/friendly
openid.ax.type.ext1=http://axschema.org/media/image/aspect11
openid.ax.type.ext2=http://axschema.org/namePerson/last
openid.ax.type.ext3=http://axschema.org/contact/state/home
openid.ax.type.ext4=http://axschema.org/contact/city/home
openid.ax.type.ext5=http://axschema.org/namePerson/first
@jjulian
jjulian / gist:2520936
Created April 28, 2012 18:08
Advice on moving to Baltimore

Derek Sivers wrote an interesting post (http://sivers.org/la) as advice for folks moving to LA. Here's my thoughts on the same topic, but about Baltimore, MD.

I moved into South Baltimore in 1996 and I've lived in this neighborhood ever since. Here are a few of my thoughts (please fork and edit):

  • Baltimore is made up of many different neighborhoods. Getting to know the character of each of the them will enhance your experience. Visiting the baseball stadium and going to dinner in the Inner Harbor does not make for a satisfying Baltimore-experience. You have to get it into the neighborhoods to find the truly great food, the fun bars, and genuine people.

  • "The Wire" is real, but you probably won't see it. Unless you're visiting your cousin who lives on West Lanvalle, you probably won't see much that resembles a Barksdale corner. And don't ask for a "Wire Tour" - that's not what we're about.

  • People are friendly, especially the older folks. If you have a chance, take a pause to listen to their story, o

@jjulian
jjulian / utils.js
Created August 7, 2012 20:55
Backbone.js collection upsert
App.Utils = {
refreshCollection: function( collection, collectionJSON ){
// update/add
_( collectionJSON ).each( function( modelJSON ) {
modelJSON._touched = true; // MARK THE ONES TO KEEP
var model = collection.get( modelJSON.id );
if( model ) {
model.set( modelJSON );
} else {
collection.add( modelJSON );
@jjulian
jjulian / stream.rb
Created September 18, 2012 12:42 — forked from davetroy/stream.rb
Capture tweets for a given lat/lon bounding box
#!/usr/bin/env ruby
$: << File.dirname(__FILE__)
require 'rubygems'
require 'eventmachine'
require 'em-http' # gem name em-http-request
require 'yajl'
require 'yajl/json_gem'
class Streamer
@jjulian
jjulian / betascape3.sample.csv
Created September 23, 2012 21:48
Transform wireshark csv packet data into a Rickshaw graph of the most chatty ip addresses. Betascape 2012 example.
No.,"Time","Source","Destination","Protocol","Length","Info"
1,"0.000000000","10.10.83.34","255.255.255.255","UDP","82","Source
2,"0.414041000","10.10.83.236","10.10.83.255","NBNS","92","Name
3,"1.102041000","10.10.82.121","255.255.255.255","UDP","82","Source
4,"1.165016000","10.10.83.236","10.10.83.255","NBNS","92","Name
5,"1.860212000","10.10.81.190","255.255.255.255","DB-LSP-DISC","163","Dropbox
6,"1.862162000","10.10.81.190","10.10.83.255","DB-LSP-DISC","163","Dropbox
7,"1.914055000","10.10.83.236","10.10.83.255","NBNS","92","Name
8,"2.727106000","Cisco_44:41:c8","Broadcast","ARP","60","Who
9,"3.494374000","10.10.80.109","255.255.255.255","DB-LSP-DISC","313","Dropbox
/*
* Magnetic Stripe Reader
* by Stephan King http://www.kingsdesign.com
*
* Reads a magnetic stripe.
*
*/
int cld1Pin = 5; // Card status pin
int rdtPin = 2; // Data pin
@jjulian
jjulian / bmorejs-oct-2012.md
Created October 25, 2012 01:54
Recap of the 2012-10-24 BmoreJS meetup "Panel Discussion" http://www.meetup.com/baltimore-dc-javascript-users/events/80846512/

BmoreJS 2012-10-24 "Panel Discussion"

http://www.meetup.com/baltimore-dc-javascript-users/events/80846512/

Panelists

  • Nick Gauthier, software developer and consultant
  • Shea Frederick, JavaScript developer at AOL
  • Josh Hepworth, coder and co-founder of Friend of the Web
  • Cory Hudson, creative director at AOL

Moderator: Jonathan Julian, software developer at 410 Labs