Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ysadka on github.
  • I am yarons (https://keybase.io/yarons) on keybase.
  • I have a public key whose fingerprint is FC47 9BBF B07D FB2E EB21 DA70 85F8 DD1F 0183 BBF5

To claim this, I am signing this object:

@ysadka
ysadka / git_flow.md
Last active December 22, 2015 04:38
Git flow and pull requests
@ysadka
ysadka / 0get_git.md
Last active December 21, 2015 14:59
Intro to Git/Github
@ysadka
ysadka / gist:5701787
Last active December 18, 2015 01:09
Intro to rails routes
Rails Routes ‘n Shit
When your rails app receives an incoming request
GET /patients/17
it asks the router to match it to a controller action.
match “/patients/:id” => “patients#show”
If the first matching route is the request, it is dispatched to the patients controller’s show action with { :id => “17” } as params.
RESOURCES creates =
GET: index (Display a list of all photos)
@ysadka
ysadka / index.html
Last active December 17, 2015 19:19 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>
@ysadka
ysadka / zoo.js
Last active December 17, 2015 16:19 — forked from dbc-challenges/zoo.js
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
function Animal(nameOfAnimal, legs){
var animal = [];
this.nameOfAnimal = nameOfAnimal;
this.legs = legs;
}
/* Here is your chance to take over Socrates!
Spend 10 minutes on each of the following hacks to the socrates website.
Enter them in the console to make sure it works and then save
your results here.
Choose a new pair for each. Add your names to the section you complete.
*/
@ysadka
ysadka / gist:5225794
Last active December 15, 2015 07:49
Write a method median which takes an Array of numbers as its input and returns the median value. You might want to look up the definition of "median."" For example, median([1,2,3]) # => 2 median([4.5, 0, -1]) # => 0 median([-100, 100]) # => 0.0
def median(array)
sorted_array = array.sort
even_or_odd = array.length % 2
odd = (sorted_array.length - 1) / 2
median_odd = sorted_array[odd]
even = sorted_array.length / 2
even_value1 = sorted_array[even]
even_value2 = sorted_array[even - 1]