Skip to content

Instantly share code, notes, and snippets.

View jonmagic's full-sized avatar

Jonathan Hoyt jonmagic

View GitHub Profile
@jonmagic
jonmagic / gist:3838029
Created October 5, 2012 04:09
Crazy helpful rake tasks for understanding what indexes to use in MongoDB (extracted from a Rails app at GitHub).
# If you are using in a Rails app just add gem 'plucky' to Gemfile.
# Otherwise install the plucky gem and require it.
# require 'plucky'
#
# Halp.mongo_db is just a shortcut to the database I already connected
# to using the mongo ruby driver.
#
# http://api.mongodb.org/ruby/current/file.TUTORIAL.html has instructions
# for the mongo ruby driver.
class Discussion
States = {
:new => 0,
:open => 1,
:closed => 2,
}
end
@jonmagic
jonmagic / gist:1810305
Created February 12, 2012 19:08
jQuery plugin template in CoffeeScript
$ = jQuery # Adds plugin object to jQuery
$.fn.extend {}= # Change the pluginName
queueSearch: (options) ->
settings = # Default settings
option1: true
option2: false
debug: false
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>jonmagic.com {{ blog.title }}</title>
<link href="{{ blog.feed.url }}" rel="self" />
<link href="{{ blog.url }}" />
<id>{{ blog.url }}</id>
<updated>{{ blog.last_updated_at | isodate }}</updated>
{% for post in blog.recent_posts.15 %}
<entry>

clarified butter

@mixin pretty_button($font_size, $gradient_color) {
$border:$font_size/2;
span {
font-size:$font_size;
line-height:$font_size * 2;
margin:$border;
padding:$font_size/3+1px $font_size*1.5;
position:relative;
text-align:center;
@include background-image(linear-gradient(top, $gradient_color, adjust-lightness($gradient_color, -15)));
@jonmagic
jonmagic / HipChat CSS mods
Created January 12, 2011 22:37
HipChat CSS Mods
a.download {display:none;}
#status_ui {display:block !important;}
div.welcomeMessage {display:none;}
Saturday
hamburgers with sweet potato fries & corn on the cob
Sunday
BLT's
Whole Sea Bass with Charred Serrano-Basil Vinaigrette, steamed broccoli & roasted potatoes
Monday
Stir-Fried Baby Bok choy & carrots with Garlic, served over lo-mien noodles
'## Silly setup stuff
Dim conn
Dim wsh
Dim sPath
Dim rs
set wsh = CreateObject("wscript.shell")
On Error Resume Next
sPath = wsh.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Helios\Helios11\Paths\DPathClient")