This file contains 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
@media all and (max-device-width: 768px) and (orientation:portrait) { | |
#site { width: 525px; } | |
nav { float: none; width: 100%; } | |
} | |
@media all and (max-device-width: 480px) { | |
#site { width: 315px; } | |
.container aside { margin-left: 0; width: 295px; } | |
nav { float: none; width: 100%; } | |
} |
This file contains 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
curl -F 'client_id=CLIENT-ID' \ | |
-F 'client_secret=CLIENT-SECRET' \ | |
-F 'object=user' \ | |
-F 'aspect=media' \ | |
-F 'verify_token=userSubscription' \ | |
-F 'callback_url=http://YOUR-CALLBACK/URL' \ | |
https://api.instagram.com/v1/subscriptions/ |
This file contains 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
require 'nokogiri' | |
require 'open-uri' | |
namespace :bookmarks do | |
desc '-- Import bookmarks in Netscape Bookmark format' | |
task :import => :environment do | |
doc = Nokogiri::HTML(open(File.join(Rails.root, "lib/dump/bookmarks_5_8_12.html"))) | |
# Ensure we're dealing with the correct format |
This file contains 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
module Cartography | |
extend self | |
# Takes OSGB36 Easting/Northing coords | |
# and returns WGS84 Latitude and Longitude | |
def en_to_ll(easting, northing) | |
@OSGB36_ll = to_OSGB36(easting, northing) | |
to_WGS84(@OSGB36_ll[:latitude], @OSGB36_ll[:longitude]) | |
end |
This file contains 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
body { | |
margin: 0; | |
line-height: 150%; | |
font-size: 72%; | |
} | |
form .sir-trevor { | |
width: 860px; | |
margin: 30px auto; | |
background: #ffffff; |
This file contains 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
require 'json' | |
class String | |
def is_json? | |
begin | |
!!JSON.parse(self) | |
rescue | |
false | |
end | |
end |
This file contains 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
host = user = User.new | |
# Store in real datetime models with timezone data, convert to UTC, and base overlap on current week | |
# to mitigate the risk of leap years, timezone shifts (summer time) etc. | |
host.time_zone = "Europe/London" | |
host.availability = [ | |
ActiveSupport::TimeZone.new(host.time_zone).parse('Wednesday 8am').utc..ActiveSupport::TimeZone.new(host.time_zone).parse('Wednesday 6pm').utc, | |
ActiveSupport::TimeZone.new(host.time_zone).parse('Friday 8am').utc..ActiveSupport::TimeZone.new(host.time_zone).parse('Friday 6pm').utc, | |
] |
This file contains 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
/** | |
* Soundcloud oEmbed discovery | |
*/ | |
SirTrevor.Blocks.Soundcloud = (function(){ | |
return SirTrevor.Block.extend({ | |
type: 'Soundcloud', | |
title: function() { return 'Soundcloud' }, |
This file contains 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
/** | |
* Mixcloud oEmbed discovery | |
*/ | |
SirTrevor.Blocks.Mixcloud = (function(){ | |
return SirTrevor.Block.extend({ | |
type: 'Mixcloud', | |
title: function() { return 'Mixcloud' }, |
This file contains 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
require 'json' | |
require 'net/http' | |
require 'uri' | |
class MissingArgumentsException < Exception | |
end | |
class VerifyUserException < Exception | |
end | |
class EAPI |
OlderNewer