Skip to content

Instantly share code, notes, and snippets.

@kadams54
kadams54 / 0 - README.md
Last active August 5, 2020 21:37
StandardJS (ESLint + Pretter) config for Cypress projects

Style

This setup adheres to JavaScript Standard Style; unfortunately due to conflict between standard's ruleset and Chai assertions, we have to acheive this by using eslint directly + the Standard rules. Since we can't use standard directly, we also throw in Prettier for code formatting. Specifically, we use prettier-standard to keep all of the pieces working together nicely. What's that mean for you? Well, here's the scoop on setting up a few editors for linting/formatting fun.

Vim

@biglovisa
biglovisa / _dashboard.js
Last active November 9, 2015 18:12
React session
// Annotated Code -- CRUD with Rails-React
// Functions we get from the React framework will be marked with -> R!
// to get the full repo: `$ git clone git@github.com:applegrain/ideabox-react.git`
// https://facebook.github.io/react/docs/thinking-in-react.html
// Good read to get into the React state of mind
// Create a new dashboard component.
var Dashboard = React.createClass({
@adamcaron
adamcaron / authorization_my_jams.markdown
Last active September 16, 2015 01:02
Step by step -- Adding Authorization for our My Jams app

Authorization for My Jams

Let's make it so an admin can see a list of all the users.

Write the test

touch test/integration/admin_users_test.rb ... In class, Mike helped us setup admin_categories_test.rb. Since this is 'My Jams', we may not be concerned with 'categories'. Instead, we'll make it so admins see a list of all the users (so perhaps an admin can change the role of a user or delete a user).

require 'test_helper'

class AdminUsersTest < ActionDispatch::IntegrationTest

Part I: User Creation

  1. add route for new_user_path
  2. create a UsersController with new action
  3. create new.html.erb
  4. generate user model with password_digest string field
  5. uncomment gem 'bcrypt' in Gemfile and add has_secure_password in User model
  6. add create action in UsersController
  7. implement logic for creating a user
  8. set session[:user_id] in create action
@JoshCheek
JoshCheek / _Readme.md
Last active August 29, 2015 14:22
Objjjjj model!

What is this?

This is the notes we made while going through 1505's Object Model at Turing School. Unfortunately, we lost an hour and a whiteboard during Object Model 1, and had to change venues. Fortunately, we got to drink, and I got the first bit recorded.

Quiz!

A while back I made this quiz. I've completely changed the material since I gave this, but the takeaways are still the same.

@JoshCheek
JoshCheek / 1503_object_model_notes.md
Last active December 18, 2018 16:53
Object Model Notes for 1503

Object Model

Bindings

  • are nodes in the stack
  • store local_variables
  • have a return value
  • have a self
@lfender6445
lfender6445 / gist:9919357
Last active May 12, 2024 19:09
Pry Cheat Sheet

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@ryansobol
ryansobol / gist:5252653
Last active November 22, 2023 11:53
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')