Skip to content

Instantly share code, notes, and snippets.

get_iplayer --stream --type=tv --modes=flashhigh2 "http://www.bbc.co.uk/iplayer/playlive/bbc_two" | mplayer -cache 2048 -
@shapeshed
shapeshed / ndch.md
Last active August 29, 2015 14:01
Guardian Article

National Day of Civic Hacking aims to empower citizens to improve communities through collaborative action.

This weekend the [National Day of Civic Hacking][2] will encourage citizens at 100 events in 120 cities to improve their communities and governments that serve them. It will promote civic hacking and open data as an opportunity to foster innovation in the civic space and make governments more transparent and accountable. Around the globe hackers, designers, entrepreneurs and citizens will work together to innovate and bring change to their communities and cities.

In Tacloban, the Philippines city that was [hit by the eye of Typhoon Haiyan][3], community development organisers are hosting an event to focus on local post-disaster redevelopment. The White House is hosting [an event][11] focusing on new ways for citizens to sign petitions and to make their voices heard. In Columbus, Ohio, city residents will be invited to collaborate on local challenges around homelessness, poverty and failing school

@shapeshed
shapeshed / coverage.sh
Created July 4, 2014 12:15
Post Coverage from TC to Github Pull Requests
#!/usr/bin/env sh
ISSUE=`echo %teamcity.build.branch% | cut -d '/' -f 1`
COVERAGE=`cat coverage/PhantomJS\ 1.9.7\ \(Linux\)/index.html | grep "Lines: <span class=\"metric\">" | awk -F ">" '{print $2}' | cut -d "<" -f1`
curl -X POST -H "Content-Type: application/json" -d "{\"body\": \"I am coveragebot! LOC code coverage is now $COVERAGE\"}" -u [mykey]:x-oauth-basic https://api.github.com/repos/BedeGaming/BingoV3/issues/$ISSUE/comments
@shapeshed
shapeshed / app.js
Last active August 29, 2015 14:07
Box.com Events Long Polling
var boxSdk = require('box-sdk');
var winston = require('winston');
var logger = new (winston.Logger)({
transports: [
new (winston.transports.File)({
filename: './events.log',
json: true
})
]
@shapeshed
shapeshed / course.json
Created December 4, 2014 09:16
course structure
{
"course": {
"name": "iOSH Health and Safety",
"arborId": "123",
"modules": [
{
"title": "Introducing Managing Safely",
"sections": [
{
"title": "Introduction",
7a29b835e5914fb4aeb2859c2c77b1d0
37d87edd33e7c75372590ba9cc2db797
@shapeshed
shapeshed / .bashrc
Created February 3, 2009 08:09
.bashrc file
########################################
# Show current Git branch in prompt
########################################
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="\h:\W\$(parse_git_branch)$ "
@shapeshed
shapeshed / clean_filenames.sh
Created February 3, 2009 13:49
Bash script to convert all filename in a folder to lowercase and replace spaces with underscores
#!/bin/bash
# Replaces spaces in filenames with underscores and converts filenames to lowercase
# Run within a directory to convert all files
ls | while read -r FILE
do
mv -v "$FILE" `echo $FILE | tr ' ' '_' | tr -d '[{}(),\!]' | tr -d "\'" | tr '[A-Z]' '[a-z]' | sed 's/_-_/_/g'`
done
@shapeshed
shapeshed / ee_disqus_exporter.rb
Created October 6, 2009 06:22
Import ExpressionEngine comments into Disqus
# Copyright 2009 Michael Ivey, released to public domain
# Disqus guts lifted from http://github.com/squeejee/disqus-sinatra-importer/tree/master
# I wanted it to run from MySQL and command line, instead of a Sinatra app
require 'rubygems'
require 'rest_client'
require 'json'
require 'sequel'
disqus_url = 'http://disqus.com/api'
@shapeshed
shapeshed / flv_convert.sh
Created November 1, 2009 10:21
Batch convert flv files to ogv and mp4 formats
#!/bin/bash
# File: flv_convert.sh
# Description: Converts flv files to ogv and mp4
#
# Copyright 2009 George Ornbo (Shape Shed)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#