Skip to content

Instantly share code, notes, and snippets.

@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
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
@richardjpope
richardjpope / gist:4452689
Last active December 10, 2015 15:09
Oyster Card backup script for ScraperWiki.com Vault
# 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),
@adammw
adammw / README.md
Created August 3, 2012 06:30
Node.js for Raspberry Pi

Node.js for Raspberry Pi

Pre-built binaries

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

@jwarchol
jwarchol / README.md
Created July 28, 2012 21:06
Breathing LED on a Raspberry Pi

Raspberry Pi Breathing LED

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

@jonsullivan
jonsullivan / cors-middleware-express-with-proxy.js
Created July 17, 2012 01:22
node.js CORS http-proxy / express middleware
// 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',
@larrybotha
larrybotha / A.markdown
Last active December 28, 2022 19:00
Monokai Sidebar Theme | Sublime Text

Sublime Text Monokai Sidebar Theme

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

@mrichie
mrichie / 0-readme.md
Created March 24, 2012 09:38 — forked from burke/0-readme.md
ruby-1.9.3-p125 cumulative performance patch.

Patched ruby 1.9.3-p125 for 30% faster rails boot

What is?

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.

@niw
niw / import_instapaper_to_redability.rb
Created March 7, 2012 11:58
A tiny script to import items from Instapaper to Readability
#!/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