Skip to content

Instantly share code, notes, and snippets.

View subratrout's full-sized avatar

Subrat Rout subratrout

View GitHub Profile
@SabretWoW
SabretWoW / rspec_model_testing_template.rb
Last active March 7, 2024 03:56
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@stevenyap
stevenyap / Start New Project.md
Last active March 1, 2018 02:14
Describes best practices in starting a ROR project

These are steps to setup a new project in ROR.
You must configure and install your Gems individually instead of copying the Gemfile from a previous project.

Refer to Heroku setup if you want to push your project to Heroku.

Setup directory

# Create directory in ~/workspace
mkdir ./testproject
cd ./testproject
@loganhasson
loganhasson / Sieve of Eratosthenes.md
Last active December 31, 2020 20:48
A Ruby example of using the Sieve of Eratosthenes to determine whether or not a number is prime

Using the Sieve of Eratosthenes to Find Prime Numbers in Ruby

The Sieve of Eratosthenes is a super efficient way to determine whether or not numbers are prime. Essentially, it takes a max number, and via the process of elimination, gives you an array that contains every prime number up to that max number.

The very short explanation is this:

  1. Create an array from 0..max
  2. Starting at 2, delete every multiple of 2 from the array.
  3. Then, go back to the beginning, and delete every multiple of 3.
  4. Repeat this starting from the next available number at the beginning of the array.
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@wkjagt
wkjagt / audio-book-reader.md
Last active April 12, 2024 14:18
How I built an audio book reader for my nearly blind grandfather

#How I built an audio book reader for my nearly blind grandfather

Tweet this - Follow me

Last year, when visiting my family back home in Holland, I also stopped by my grand-parents. My grand-father, now 93 years old, had always been a very active man. However, during the presceding couple of months, he'd gone almost completely blind and now spent his days sitting in a chair. Trying to think of something for him to do, I suggested he try out audio books. After finally convincing him -- he said audio books were for sad old people -- that listening to a well performed recording is actually a wonderful experience, I realized the problem of this idea.

####The problem with audio devices and the newly blind. After my first impulse to jump up and go buy him an

@andycandrea
andycandrea / resources.md
Last active July 10, 2018 19:14 — forked from zporter/resources.md
A list of resources for learning Rails and relevant technologies

A list of resources that aspiring Rails developers can use to learn Rails and other relevant technologies. This list includes some resources that I see recommended all over the web--not all of which I like--as well as some hidden gems that I've found valuable. This list is intended to supplement my blog post here.

Ruby

  • Codecademy
    • One of the more well-known sites to offer interactive programming tutorials, Codecademy is probably best utilized by those who are pretty new to programming, though the Ruby tutorial is good for teaching Ruby syntax and eventually gets into some less trivial material.
  • Try Ruby
  • Pretty similar to Codecademy. Once again, it's beginner-friendly, though, as someone who knew about object-oriented programming beforehand, I found it somewhat annoying to use, as there's no page with links to the individual exercises (at le
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do

Git Cheat Sheet

Commands

Getting Started

git init

or

@DrummerHead
DrummerHead / frontend-programming-design-resources.md
Last active March 28, 2024 20:34
List of Front-end, programming & design resources
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links