Skip to content

Instantly share code, notes, and snippets.

View fieldform's full-sized avatar

Mark Domino fieldform

View GitHub Profile
@ambethia
ambethia / seeds.rb
Created September 15, 2009 16:40
Using environment specific yaml fixtures as seed data in Rails 2.3.4
# == Using environment specific yaml fixtures as seed data in Rails 2.3.4
#
# Setup your directory structure like below:
#
# -- RAILS_ROOT
# `-- db
# |-- seeds
# | |-- development
# | | |-- books.yml
# | | `-- users.yml
/*
The MIT License (MIT)
Copyright (c) 2014 Ismael Celis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is

Getting started

First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.

@drnic
drnic / .gitignore
Created October 1, 2010 22:18 — forked from mloughran/README.md
twitter.json
#!/bin/bash
# NOTE: this is an OSX launchd wrapper shell script for Tomcat (to be placed in $CATALINA_HOME/bin)
CATALINA_HOME=/Users/username/tomcat
function shutdown() {
date
echo "Shutting down Tomcat"
$CATALINA_HOME/bin/catalina.sh stop
@chrisyour
chrisyour / Folder Preferences
Created December 4, 2010 20:05
Show hidden files and hidden folders (except .git) in your TextMate project drawer
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
@mhl
mhl / git-fetch-and-fast-forward-all-branches.sh
Created April 22, 2011 11:35
An example script to show how to fetch from all default remotes and do any fast-forwards of local branches from upstream possible
#!/bin/sh
set -e
CURRENT_BRANCH="$(git symbolic-ref HEAD)"
CURRENT_BRANCH_UPSTREAM="$(git rev-parse --symbolic-full-name @{u} 2> /dev/null)"
# Update the remote-tracking branches for every remote for which
# remote.<name>.skipDefaultUpdate is not true:
git remote update default
@valpackett
valpackett / bench.clj
Created July 10, 2011 18:52
OpenCL vs Clojure, CPU vs GPU Fibonacci benchmark
(use 'calx)
(def benchn 40)
(def ocl-src "int fib(int a) {
int b = -1;
int c = 1;
int d;
int i;
for (i=0;i<=a;i++) {
d = c + b;
@nuxlli
nuxlli / sublime_text_2_useful_shortcuts.md
Created September 9, 2011 18:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@bkutil
bkutil / deploy.rb
Created December 4, 2011 22:22 — forked from andruby/deploy.rb
Start and Stop tasks for resque workers and resque scheduler with capistrano deploy hook (without God)
after "deploy:symlink", "deploy:restart_workers"
after "deploy:restart_workers", "deploy:restart_scheduler"
##
# Rake helper task.
# http://pastie.org/255489
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/
def run_remote_rake(rake_cmd)
rake_args = ENV['RAKE_ARGS'].to_s.split(',')