Skip to content

Instantly share code, notes, and snippets.

View oddlyzen's full-sized avatar
:electron:
Working with Electron

Mark Coates oddlyzen

:electron:
Working with Electron
View GitHub Profile
Rails3 - CheatSheet - CommandLine
rails new ApplicationName – Create a new application
rails _3.0.9_ new ApplicationName – Create a new application with a specific version of rails
rails generate/g model ModelName – Creates a model with the specified model_name
rails generate/g controller ControllerName – Creates a controller with the specified controller_name
rails generate/g migration MigrationName – Creates a migration with the specified migration_name
rails generate/g scaffold ModelName ControllerName – A shortcut for creating your controller, model and view files etc.
rails destroy controller ControllerName – Destroys the created controller and its related file.
rails destroy model - Destroys the created model and its related file.
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@oddlyzen
oddlyzen / rspec-syntax-cheat-sheet.rb
Created December 12, 2011 16:56 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@oddlyzen
oddlyzen / gist:1327766
Created October 31, 2011 15:34
My .bash_profile for custom prompt, parsing git branch, and common aliases
#export PS1="\[\e[1;30;32m\]| => \[\e[0m\]"
alias ss="script/server"
alias sc="script/console"
alias d="ls -G"
alias ll="d"
alias lsd="ls -lahG"
alias cdt="cd ~/code/dtime_web"
alias cdtd="cd ~/code/oms"
alias gs="git status"
@oddlyzen
oddlyzen / gist:1229903
Created September 20, 2011 18:34
Tracing Ruby Execution
set_trace_func proc { |event, file, line, id, binding, classname|
printf "%8s %s:%-2d %10s %8s\n", event, file, line, id, classname
}
t = Test.new
t.test
set_trace_func nil
@oddlyzen
oddlyzen / index.html
Created September 20, 2011 17:15
Cool CSS Flicker Animation - from http://ringshia.com
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="Pratik Ringshia's website">
<meta name="keywords" content="pratik ringshia, pratik, ringshia, personal, website">
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<style type="text/css">
@oddlyzen
oddlyzen / custom-data-html5.html
Created June 28, 2011 22:59
Custom 'data-' attributes in HTML5
<li class="user" data-name="John Resig" data-city="Boston"
data-lang="js" data-food="Bacon">
<b>John says:</b> <span>Hello, how are you?</span>
</li>
@oddlyzen
oddlyzen / express.js
Created June 27, 2011 22:26
Express on Node.js
var app = express.createServer();
app.get('/', function(req, res){
res.send('Hello World');
});
app.listen(3000);
public int deviationAmount = 20;
public ArrayList trackers = new ArrayList();
Hashtable trackerLookup = new Hashtable();
private ArrayList ended;
private TouchTracker tracker;
private ArrayList movements;
....
void Update () {
// clean all touches (so they know if they aren't updated after we pull info)
for(i=0;i<trackers.Count;i++)
alias gc='git commit -am'
alias lsd='ls -la'
alias coed='cd ~/code/collegeonly && mate .'
alias cost='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start && rake sunspot:solr:start && rake sunspot:solr:start RAILS_ENV=cucumber &&
rake redis:development:start && rake redis:test:start && script/server -p2323'
alias gco='git co'
alias ss="script/server"
alias sc="script/console"
alias cdco="cd ~/code/collegeonly"
alias cdan="cd ~/code/achievenext"