View custom_cell.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomCell < UITableViewCell | |
def location=(value) | |
@locationLabel.text = value | |
end | |
def ringName=(value) | |
@ringNameLabel.text = value | |
end |
View schema.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Spit out Schemaspy docs for a rails project, on a postgres db | |
# | |
# Assumes: | |
# - Have installed graphviz installed & in the path | |
# If not run 'brew install graphviz' | |
# - java installed & in the path | |
# - postgresql-9.3-1102.jdbc41.jar in current dir | |
# - schemaSpy_5.0.0.jar in current dir |
View dbutil.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Backup, or Restore your postgres database | |
# | |
set -e | |
usage() | |
{ | |
cat << EOF |
View vcap.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Capture iSight Camera to a iSight.mpg file | |
# | |
# Press 'q' to stop capture | |
# | |
ffmpeg -f avfoundation -i "FaceTime" iSight.mpg |
View ffmpeg_filter.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ffmpeg -i in.mov -vf "vflip" out.mov |
View ffserver.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run via: | |
# ffserver -d -f ffserver.conf | |
Port 8090 | |
BindAddress 0.0.0.0 | |
MaxHTTPConnections 2000 | |
MaxClients 1000 | |
MaxBandwidth 1000 | |
CustomLog - | |
NoDaemon |
View serve_mov.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ffmpeg -i in.mov -f ffm http://127.0.0.1:8090/feed1.ffm |
View custom_formatter.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Rspec 2.x custom formatter that will run all your tests and output a list of spec files that have been run | |
# | |
# Can be usefull for extracting all of the files that nmake up the test run | |
# | |
# TZ=Pacific/Auckland bundle exec rspec spec --tag ~integration --tag ~fragile --require ./custom_formatter.rb --format CustomFormatter --out specs.txt --seed 34104 | |
# | |
require "rspec/core/formatters/base_text_formatter" | |
require 'JSON' | |
class CustomFormatter < RSpec::Core::Formatters::BaseTextFormatter |
View test_specs.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Run a failing spec in combination with each other spec and record which combinations cause a failure | |
# | |
# Put a list of all specs into specs.txt | |
# eg: $ $ find spec -name '*_spec.rb' -print > specs.txt | |
# Set the failingspec variable below | |
# Set the seed variable below | |
# | |
# Writes a log to testspec.log, which is formatted as follows: |
View findext.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ruby | |
# Output a list of the unique file extensions in this directory and all subdirectories | |
# lowercased and sorted | |
extensions = {} | |
Dir.glob('**/*') do |f| | |
ext = File.extname(f).downcase | |
extensions[ext] = ext if ext | |
end | |
puts extensions.keys.sort |
OlderNewer