Skip to content

Instantly share code, notes, and snippets.

/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@laptite
laptite / check-paperclip-attachment.md
Last active May 5, 2016 18:18 — forked from kinopyo/gist:2224867
Check whether a Paperclip attachment exists

Check whether a Paperclip attachment exists

Don’t simply test for the presence of the magic Paperclip attribute, it will return a paperclip Attachment object and thus always be true:

- if user.photo.present? # always true
  = image_tag(user.photo.url)
@laptite
laptite / capybara cheat sheet
Last active August 23, 2016 20:27 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
# Edited from fork zhengjia/capybara cheat sheet
# References
# https://gist.github.com/zhengjia/428105
# http://www.railscook.com/recipes/capybara-cheat-sheet/
* [bold] expectation
=Navigating=
page.visit( '/projects’ ) < inclusion of page. is optional

Oops! I accidentally deleted a local git branch, and I haven't pushed it to a remote server yet. The branch has several important commits, and it hasn't been merged with any other branches yet. How do I find the missing branch?

1. Create a list of all dangling or unreachable commits.

$ git fsck --full --no-reflogs --unreachable --lost-found
unreachable tree 4a407b1b09e0d8a16be70aa1547332432a698e18
unreachable tree 5040d8cf08c78119e66b9a3f8c4b61a240229259
unreachable tree 60c0ce61b040f5e604850f747f525e88043dae12
unreachable tree f080522d06b9853a2f18eeeb898724da4af7aed9

JavaScript Part 1

Topics:

  • Variables & Data types
  • Conditional Statements
  • Functions & Scope
  • setting up a document to use jQuery
  • jQuery Selectors & Methods
  • Retrieving Form Values
  • Arrays

Student Ruby Assessment

Instructions

  • Create a file with "<yourName>_assessment.rb".

Sections 1-6

  • Title each section with a comment that includes the name and number of each section.
  • Then write the ruby that fulfills each lettered instruction under the title. There is no need to structure your code based on the lettered instructions.
  • If you need to use code from a previous numbered section please cut and paste into the approrpriate section.

This is a list of steps to:

  • Setup a new Rails app
  • Initialize a local repository using git
  • Create a new remote repository using GitHub
  • Change README.rdoc
  • Deploy to a cloud service - Heroku

Assumptions:

  • Ruby is installed (v 1.9.3)
  • Rails is installed (v 3.2.3)

##Objectives: Use String, Hash, Array, and Enumerable methods to decode a string and discover a secret message

INSPIRATION: http://www.youtube.com/watch?v=Wj1d85CLDOQ

##Skills: String.split, Array.each, Hash.each, Hash.sort_by, Range.to_a, Array.reverse, Array.push, Array.join, String.gsub, Array.index

##Instructions: Comments explain steps to manipulate string