This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def remote_link_to(name, path, options={}) | |
options['remote'] = 'true' | |
options['data-type'] = 'html' | |
link_to(name, path, options) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://github.com/rick/linode | |
### CREATE STACKSCRIPT | |
require 'linode' | |
s = Linode::Stackscript.new :api_key => 'linode-key-which-you-can-request-from-your-account' | |
s.create :label => 'amazingbox', :distributionIDList => '64', :script => '#!/bin/bash\nls -latr' | |
# '64' happens to be the distro for Ubuntu 10.04 LTS. | |
# Find distribution IDs with Linode.new.avail.distributions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('<button>Archive Ten</button>') | |
.click(function() { | |
$('#bookmark_list a.archiveButton').slice(0,9).click(); | |
}) | |
.insertBefore($('body').children().first()) | |
# include jQuery in the libraries tab and apply this script in http://instapaper.com/u |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
currentPathname = null | |
window.onpopstate = (ev) -> | |
return if document.location.pathname == currentPathname | |
currentPathname = document.location.pathname | |
#... (now handle a real back-button or page load event) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stdClass Object | |
( | |
[kind] => plus#activityFeed | |
[etag] => "ZwWl8AwTPaXkrMWBfKc2FkKQ8tw/1E7E4zLv-EPrvXkeslyavUfGMj0" | |
[nextPageToken] => eJyNkzFIw0AUht-FlEZczuJayKKTdq6CkNEOKs4ujRAKUktNTSkOEh1U0E2dXAR16ySCoCCu4uriJm4KgpOuJne5u5fkAv6Fy-Xee__3-rgMv6DU82Fsze27tbbbadUanU2v5fmV9_PL3539ugGkAaW-2w68gQ9U5S0G66uevzc8rY6evB0aAIMuwETY24BtiFWWu_HAB2OlsXDXnOx_Xl8lqVC-t2-aL6_L9bnj562zme7DxfTTz1L1e_boo3sbxMUlADIFKYVstaOflCM2hK0m5EVwWiwjFaZhrsJKAJbGzcIRqoAU90FRwUGWSviLARKc78DWoZmzBKoMqslzdK5FpkymWCOEboxKfNShsuTd5nk4XSg9fLsoJDsoco19Tdzno9hY6iHQu9iTOJC5FESh5FlynGpQEsKkJjcn-RdMfBMoOkUu_BETLKqJo86YnGwQdQNQYRjODwsyEfUfsjVnht5EB3TiJXM1DU1ekixodp5tskLBTF8nkZBonvC4rR-XI9349xeidyYBoZiY6kxpBBfEu2j_BzL3RsU | |
[selfLink] => https://www.googleapis.com/plus/v1/people/106413090159067280619/activities/public? | |
[nextLink] => https://www.googleapis.com/plus/v1/people/106413090159067280619/activities/public?maxResults=20&pageToken=eJyNkzFIw0AUht-FlEZczuJayKKTdq6CkNEOKs4ujRAKUktNTSkOEh1U0E2dXAR16ySCoCCu4uriJm4KgpOuJne5u5fkAv6Fy-Xee_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def duration(from, to=Time.now) | |
if to - from < 1.day | |
distance_of_time_in_words(from,to,false,:precision=>1) | |
else | |
return distance_of_time_in_words(from,to,false,:precision=>2, :two_words_connector=>'@') | |
.gsub(/@(\d+)\sseconds?/, ', \\1s') | |
.gsub(/@(\d+)\sminutes?/, ', \\1m') | |
.gsub(/@(\d+)\shours?/, ', \\1h') | |
.gsub(/@(\d+)\sdays?/, ', \\1d') | |
.gsub(/@(\d+)\sweeks?/, ', \\1w') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you get this weird error from rake assets:precompile: | |
Invalid CSS after "...rder-radius: 0/": expected expression (e.g. 1px, bold), was ";" | |
Go find a line in bootstrap.css: | |
border-radius: 0 \0/; | |
and remove or change it to just 0. (Good enough anyway.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AddIndexes < ActiveRecord::Migration | |
INDEXES = { | |
:blogs => %w/title author_id/, | |
:comments => %w/blog_id subject poster_id/, | |
:events => %w/name place when/ | |
} | |
def up | |
INDEXES.each { |table, cols | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Made this a proper GitHub Repo: | |
https://github.com/mahemoff/geodata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
article | |
> .row:first-child | |
> | |
.span1,.span2,.span3,.span4,.span5,.span6,.span7,.span8,.span9,.span10,.span11,.span12 | |
padding-top: 20px | |
> .row:last-child | |
> | |
.span1,.span2,.span3,.span4,.span5,.span6,.span7,.span8,.span9,.span10,.span11,.span12 | |
padding-bottom: 20px |