Recent releases have been pre-built using cross-compilers and this script and are downloadable below.
If you have found these packages useful, give me a shout out on twitter: @adammw
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
# This is a very basic script to backup oyster card data to a scraperwiki vault | |
# Notes: | |
# 1) You need an oyster card that has been registered on tfl.gov.uk | |
# 2) This script requires you to enter your username and password (this about what that means before progressing, and do so at your own risk) | |
# 3) This script should be run in a PRIVATE SCRAPERWIKI VAULT ONLY https://scraperwiki.com/pricing/ not a public scraper, or the world will know your password | |
import scraperwiki | |
import mechanize | |
import lxml.html | |
from lxml.etree import tostring |
@media only screen and (min-width: 320px) { | |
/* Small screen, non-retina */ | |
} | |
@media | |
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px), |
Recent releases have been pre-built using cross-compilers and this script and are downloadable below.
If you have found these packages useful, give me a shout out on twitter: @adammw
This is a demonstration of using Ruby and the WiringPi Gem to pulse an LED connected to a GPIO pin in a manner similar to the sleep indicator on a MacBook.
A video of the effect can be found here: http://www.youtube.com/watch?v=NCUMXK7qf-c
// node.js proxy server example for adding CORS headers to any existing http services. | |
// yes, i know this is super basic, that's why it's here. use this to help understand how http-proxy works with express if you need future routing capabilities | |
var httpProxy = require('http-proxy'), | |
express = require('express'); | |
var proxy = new httpProxy.RoutingProxy(); | |
var proxyOptions = { | |
host: '192.168.3.11', |
A theme for the sidebar in Sublime Text to match the workspace of the Monokai theme.
This theme only modifies the sidebar to better match the Monokai theme, without modifying any of the styling elsewhere defined by Monokai.
File location: Packages/User
For a theme that extends beyond just the sidebar, visit https://gist.github.com/umpirsky/5842174
This script installs a patched version of ruby 1.9.3-p125 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.
Huge thanks to funny-falcon for the performance patches.
#!/usr/bin/env ruby | |
require 'csv' | |
require 'net/smtp' | |
require 'resolv' | |
# We need a specific version of eventmachine due to apply a patch. | |
gem 'eventmachine', '0.12.10' | |
require 'eventmachine' |
def hash_to_ostruct(object) | |
return case object | |
when Hash | |
object = object.clone | |
object.each do |key, value| | |
object[key] = hash_to_ostruct(value) | |
end | |
OpenStruct.new(object) | |
when Array | |
object = object.clone |