Skip to content

Instantly share code, notes, and snippets.

View cczona's full-sized avatar

Carina C. Zona cczona

View GitHub Profile
@rwest
rwest / README
Created January 9, 2012 16:42 — forked from symposion/README
Convert OS X Keychain exported entries into logins for 1Password import
These two files should help you to import passwords from mac OS X keychains to 1password.
Assumptions:
1) You have some experience with scripting/are a power-user. These scripts worked for me
but they haven't been extensively tested and if they don't work, you're on your own!
Please read this whole document before starting this process. If any of it seems
incomprehensible/frightening/over your head please do not use these scripts. You will
probably do something Very Bad and I wouldn't want that.
2) You have ruby 1.9.2 installed on your machine. This comes as standard with Lion, previous
versions of OS X may have earlier versions of ruby, which *may* work, but then again, they
@ikennaokpala
ikennaokpala / spork.md
Created February 14, 2012 00:08
Setup rspec, spork and autotest notifications

Generate project without tests:

rails new project_name -T

Edit Gemfile:

group :development do
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@ticktricktrack
ticktricktrack / rspec_runthrough.md
Created March 26, 2012 15:51
RSpec Runthrough March 2012

Rspec

Philosophy

The suite of tests is not there to satisfy the QA groups, it is not there to prove to other people that our code works. The suite of tests is there so that we can refactor. So that when we bring the code up to our screen then we're not afraid of it. @unclebobmartin

List of useful resources

@awesome
awesome / gist:2409675
Created April 17, 2012 22:56
factory girl build vs create
#http://archived.rpheath.com/posts/411-how-to-use-factory-girl-with-rspec
describe Whatever do
before(:each) do
@user = Factory.build(:user) # returns an unsaved object
@user = Factory.create(:user) # returns a saved object
@user = Factory(:user) # shortcut for Factory.create()
end
it "should be a dumb test to show usage" do
@user.name.should == "Ryan Heath"
@unak
unak / history.txt
Last active November 29, 2021 01:40
The History of Ruby
* Only the releases of the stable versions are listed in principle. The releases of the unstable versions especially considered to be important are indicated as "not stable."
* The branches used as the source of each releases are specified, and the branching timing of them are also shown. BTW, before subversionizing of the repository, the term called "trunk" was not used, but this list uses it in order to avoid confusion.
* In order to show a historical backdrop, big conferences (RubyKaigi, RubyConf and Euruko) are also listed. About the venues of such conferences, general English notations are adopted, in my hope.
* ruby_1_8_7 branch was recut from v1_8_7 tag after the 1.8.7 release because of an accident.
* 1.2.1 release was canceled once, and the 2nd release called "repack" was performed. Although there were other examples similar to this, since the re-releases were performed during the same day, it does not write clearly in particular.
* Since 1.0 was released with the date in large quantities, the mi
@johana-star
johana-star / my_names.txt
Last active December 10, 2015 21:48
A biographical sketch of the names I have used legally.
When I was born, my parents named me B_____ Daniel Strand.* I went by this name in childhood,
as a teenager, and as a young adult. While I was in college, I began using Livejournal, and used
strand as my handle there. I also preferred that people call me Strand then, but told people that
they could refer to me by my last name or my former first name at the time.
A few years after I graduated college, after working several jobs where colleagues and
coworkers called me Strand, I had my name legally changed to B Strand. I realized almost
immediately afterwards that I would have mad my life easier had I adopted the name Be Strand,
as many computer systems do not accept B as a first name. (I was unable to use Priceline at one
time, though they have since fixed this bug.)

git rm $(git ls-files -d)

➜  demo git:(master) rm README.rdoc 
➜  demo git:(master) ✗ g s
 D README.rdoc
➜  demo git:(master) ✗ git rm $(git ls-files -d) 
rm 'README.rdoc'
➜  demo git:(master) ✗ g s
D README.rdoc
@mtitolo
mtitolo / open instaweb in chrome
Last active December 11, 2015 02:58
How to get instaweb running on OSX and opening in Chrome. Run these commands!
$ brew install lighttpd
$ git config --global instaweb.browser ch
$ git config --global browser.ch.cmd "open -a \"/Applications/Google Chrome.app\""
@sdball
sdball / sandi_metz_rules_for_developers.md
Created January 18, 2013 18:47
Rules for good development from Sandi Metz

Sandi Metz’ rules for developers

  1. Your class can be no longer than a hundred lines of code.
  2. Your methods can be no longer than five lines of code
  3. You can pass no more than four parameters and you can't just make it one big hash.
  4. In your controller, you can only instantiate one object, to do whatever it is that needs to be done.
  5. Your view can only know about one instance variable.
  6. Your Rails view should only send messages to that object i.e., no Demeter violations.[ "thunder dome principal". Translated: one model in, one model out! ]
  7. Rules are meant to be broken if by breaking them you produce better code. [ ...where "better code" is validated by explaining why you want to break the rule to someone else. ]