Software Engineering Resources

A collection of resources, cheatsheets and code snippets I found helpful (or kept forgetting) during my Flatiron Software Engineering bootcamp.

HEY FRIENDS! This repo/resource is a perpetual work in progress. I'm not sure how big I want to expand it, but had a thought to include some resources I am gathering for my own knowledge. I'm open to suggestions or contributions.

To-Dos

  • What is the difference between find, find_by & find_by_id?
  • Sessions
  • RESTful routes
  • Atom packages

Algorithms

Resources recommended by others in the community.

Bundler

Run the following code to have bundler create a new Ruby project for you

bundler gem name_of_your_project_repo

Forms

A hidden input for editing or deleting data with a form

<input type="hidden" name="_method" value="patch">

Git

Delete a Local Branch

git branch -d BRANCHNAME

Create a New, Empty Branch

git checkout --orphan NEWBRANCH
git rm -rf .

Resources

Nokogiri

Open a new website for scraping

Nokogiri:HTML(open("http://www.example.com"))

Rake

See a list of all available Rake tasks.

Rake -T

Seed Data

  1. Within the db folder, create a file named seeds.rb.
  2. Create object instances. For example: Dog.create(:name => "Fido", :breed => "mutt"). Using create as opposed to new creates the Ruby object and saves it to the database
  3. Run rake db:seed

Ruby

Resources I have referenced or others have referenced

Substitute a character in a string for another character

string.gsub("character-to-target","character-to-replace")

Gems

  • Bcrypt. An easy way to keep your users' passwords secure.
  • Bundler.Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed.
  • Corneal. A Ruby gem that is a Sinatra app generator with Rails-like simplicity
  • Faker. A library for generating fake data such as names, addresses, and phone numbers.
  • Nokogiri. Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser
  • Rake. Rake is a Make-like program implemented in Ruby. Tasks and dependencies are specified in standard Ruby syntax.
  • Shotgun. This is an automatic reloading version of the rackup command that's shipped with Rack.
  • Tux. Tux dresses up sinatra in a shell. Use it to interact with your helpers, view rendering and your app's response objects.

Terminal / CLI

Open an item or folder in a specific application

application .

For example, to open a folder in Atom, you would use this command

atom .

Clear the terminal window

clear

Create a new file

touch file-name.txt

Create a new directory

mkdir directory-name

Create a new branch and switch to it

git checkout -b branch-name

Markdown

Create an alert box. Reference: https://stackoverflow.com/questions/50544499/how-to-make-a-styled-markdown-admonition-box-in-a-github-gist

| WARNING: Don't do the thing! |
| --- |