Skip to content

Instantly share code, notes, and snippets.

Stef Lewandowski stefl

Block or report user

Report or block stefl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View designer.html
<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>
View Install Ruby WordNet on Mac OS X
(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/
View uk-postcodes.rb
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
View Add many users to a twitter list
usernames = "mrmactout
angusmactout
elsbethmactout
sgtmacfuzz
mrsmactoffy
professordunkopf
ferociousness1983
littleness1983
hungryness1983".split("\n")
View A quick mashup for Royal Court
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
View Ruby rounding bug using floor on a float
If you do this:
(205.00).floor
You would expect 205.
Likewise with:
(2.05*100).floor
@stefl
stefl / gist:798516
Created Jan 27, 2011
carbon coder video timecode inject
View gist:798516
<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 Feb 5, 2011
Json gem users take note...
View gist:812700
# 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 Mar 12, 2011
Redirect trailing slashes in Sinatra
View gist:867165
get %r{(.+)/$} do |r| redirect r; end;
@stefl
stefl / gist:888150
Created Mar 26, 2011
extract starting timecode from a video file using mediainfo
View gist:888150
mediainfo -f /files/timecode/528006c9-33b0-4a89-9b94-c9bf7f6be2a9.mov | grep '^Delay.*: [0-9][0-9]:' | awk '{split($0,a,": "); print a[2]}'
You can’t perform that action at this time.