Skip to content

Instantly share code, notes, and snippets.

View omnifroodle's full-sized avatar

Matt Overstreet omnifroodle

  • DataStax
  • Richmond, VA
View GitHub Profile
# Fish git prompt
set __fish_git_prompt_showdirtystate 'yes'
set __fish_git_prompt_showstashstate 'yes'
set __fish_git_prompt_showupstream 'yes'
set __fish_git_prompt_color_branch yellow
# Status Chars
set __fish_git_prompt_char_dirtystate '✎ '
set __fish_git_prompt_char_stagedstate '☑ '
set __fish_git_prompt_char_stashstate '☄ '
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after app launch
[self createEditableCopyOfDatabaseIfNeeded];
UIView *backgroundView = [[UIView alloc] initWithFrame: window.frame];
backgroundView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]];
[window addSubview:backgroundView];
[backgroundView release];
[window addSubview:tabcontroller.view];
#example with a formatted date and a boolean
xml.instruct!
xml.declare! :DOCTYPE, :plist, :PUBLIC, "-//Apple Computer//DTD PLIST 1.0//EN", "http://www.apple.com/DTDs/PropertyList-1.0.dtd"
xml.plist("version" => 1.0) do |plist|
plist.dict do |wrapper|
@occasions.each do |occasion|
wrapper.key occasion.id
wrapper.dict do |dict|
dict.key 'ccd_remote_id' # required id from the system of record (rails db in this case)
/*
Variable Grid System.
Learn more ~ http://www.spry-soft.com/grids/
Based on 960 Grid System - http://960.gs/
Licensed under GPL and MIT.
*/
/* Containers
----------------------------------------------------------------------------------------------------*/
@omnifroodle
omnifroodle / deploy.rb
Created May 6, 2010 03:53
a generic capistrano deploy file suitable for most rails apps
require 'active_support'
DEPLOY_CONFIG = YAML::load(File.open("config/deploy.yml"))
default_run_options[:pty] = true
#
# General Deployment settings
#
set :application, DEPLOY_CONFIG['application']
set :repository, DEPLOY_CONFIG['repository'] || 'master'
set :scm, :git
@omnifroodle
omnifroodle / caller
Created March 3, 2011 04:37
simple webview activity which takes an image url as an argument
public void onClick(View v) {
Intent i;
switch (v.getId()) {
....
case R.id.east_map_button:
i = new Intent(this, MapZoom.class);
i.putExtra(MAP_URL, "file:///android_res/drawable/east.png");
startActivity(i);
@omnifroodle
omnifroodle / solrrp.ru
Created May 25, 2011 22:28
Rackup file for limiting access to a reverse proxied solr instance (thinking ajax)
# config.ru for solr reverse_proxy
# test me with $ rackup solrrp.ru
# or just do most of this in you web sever config
require 'server'
require 'rack/reverse_proxy'
require 'my_custom_logger'
# catch and log requests
use MyCustomLogger # some code you wrote that logs info about results on the /search* endpoint
@omnifroodle
omnifroodle / die.rb
Created May 27, 2011 01:26
Earthdawn Dice
class Die
attr_reader :d, :face, :bonus, :modifier
def initialize(d)
parse_d(d)
@face = roll
if @d == @face
@bonus = Die.new(d)
end
end
@omnifroodle
omnifroodle / install_homebrew.rb
Created August 8, 2011 05:46 — forked from mxcl/install_homebrew.markdown
Installs Homebrew to /usr/local so you don't need sudo to `brew install`
#!/usr/bin/ruby
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like.
module Tty extend self
def blue; bold 34; end
def white; bold 39; end
def red; underline 31; end
def reset; escape 0; end
def bold n; escape "1;#{n}" end
@omnifroodle
omnifroodle / gist:1990889
Created March 7, 2012 04:12
server spinner
for INSTANCE in `cat ~/instance_addr_list`
do
echo '------------'
echo $INSTANCE
echo '------------'
for i in 1 2
do
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=false $INSTANCE "nohup sh ~/bin/image-node/do-task.sh &> /dev/null &"
done
done