Skip to content

Instantly share code, notes, and snippets.

View stefl's full-sized avatar

Stef Lewandowski stefl

View GitHub Profile
@stefl
stefl / designer.html
Created April 3, 2015 12:01
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element">
<template>
<style>
(Untested - this is the gist of what you need to do)
Install Macports
http://www.macports.org/install.php
Get the latest TCL/TK:
http://www.activestate.com/activetcl/
require 'rubygems'
require 'weary'
class Postie
def get(code)
(Weary.get "http://www.uk-postcodes.com/postcode/#{code.gsub(' ', '')}.json").perform
end
end
postie = Postie.new
usernames = "mrmactout
angusmactout
elsbethmactout
sgtmacfuzz
mrsmactoffy
professordunkopf
ferociousness1983
littleness1983
hungryness1983".split("\n")
Here are the commands I used to create http://royalcourt.heroku.com
(Assuming ruby, rubygems, heroku, git)
sudo gem install caboodle
caboodle create royalcourt
cd royalcourt
caboodle kit:add flickr
(input flickr username)
caboodle kit:add twitter
If you do this:
(205.00).floor
You would expect 205.
Likewise with:
(2.05*100).floor
@stefl
stefl / gist:798516
Created January 27, 2011 13:45
carbon coder video timecode inject
<cnpsXML StartTimeCode="00:00:05;00"> <Markers>
<Marker_1 MarkerTime_27MHz.QWD="270000000" MarkerName="Marker1"/>
<Marker_2 MarkerTime_27MHz.QWD="540000000" MarkerName="Marker2"/>
<MyMarker MarkerTime_27MHz.QWD="810000000" MarkerName="MyMarker"/>
</Markers> </cnpsXML>
@stefl
stefl / gist:812700
Created February 5, 2011 19:25
Json gem users take note...
# Deal with the usual JSON gem idiocy. Guys, come on. I want to serialize an integer, surely this can't be that hard
class Fixnum
def to_json(options = nil)
to_s
end
end
@stefl
stefl / gist:867165
Created March 12, 2011 09:58
Redirect trailing slashes in Sinatra
get %r{(.+)/$} do |r| redirect r; end;
@stefl
stefl / gist:888150
Created March 26, 2011 09:04
extract starting timecode from a video file using mediainfo
mediainfo -f /files/timecode/528006c9-33b0-4a89-9b94-c9bf7f6be2a9.mov | grep '^Delay.*: [0-9][0-9]:' | awk '{split($0,a,": "); print a[2]}'