Skip to content

Instantly share code, notes, and snippets.

View bhgupta01's full-sized avatar

Bhawana Gupta bhgupta01

View GitHub Profile
@swalkinshaw
swalkinshaw / README.md
Last active December 14, 2023 20:53
Secret Santa

Holiday Gift Exchange Problem

Description

A Holiday gift exchange is where a group of people are randomly assigned one other person in the group to buy a gift for. This person can be anyone else in the group except for themselves. Everyone should both give and receive a gift.

Design a program that reads a provided CSV file, performs the matching, and then prints out the matches. Assume that you may email the match to the person later, but focus on printing first.

The format of the CSV is name,email on each row.

@subfuzion
subfuzion / curl.md
Last active November 11, 2024 03:27
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@mandiwise
mandiwise / Count lines in Git repo
Last active September 29, 2024 19:44
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
@lfender6445
lfender6445 / gist:9919357
Last active November 7, 2024 08:35
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

@zilkey
zilkey / private_constant.rb
Created October 22, 2013 22:40
Ruby's private_constant example
module Foo
class Bar
end
private_constant :Bar
end
module Foo
p Bar.new # => works fine because we're scoped to Foo