Skip to content

Instantly share code, notes, and snippets.

# Takes an interger and outputs as a string representation
def ascending?(first, second, third)
first < second && second < third
end
def descending?(first, second, third)
first > second && second > third
end
# Takes an interger and outputs as a string representation
def ascending?(first, second, third)
first < second && second < third
end
def descending?(first, second, third)
first > second && second > third
end
@willmcneilly
willmcneilly / factorial-function.html
Last active August 29, 2015 13:58
Find factorial by iteration, use one return statement in iterator
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Find fctorial by iteration, use one return statement in iterator" />
<meta charset="utf-8">
<title>Find factorial by functional iteration</title>
</head>
<body>
</body>
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
</body>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
</body>
</html>
@willmcneilly
willmcneilly / candy-crush-match.js
Last active August 29, 2015 13:57
Check for consecutive matches in multidimensional array in both rows and columns. Return the index of each match. Candy Crush style matching.
var grid =
[
['a', 'b', 'c', 'c', 'c', 'c', 'c', 'd'],
['a', 'c', 'a', 'c', 'a', 'a', 'b', 'a'],
['b', 'a', 'c', 'a', 'b', 'a', 'b', 'b'],
['a', 'a', 'a', 'b', 'a', 'd', 'b', 'b'],
['a', 'b', 'c', 'a', 'a', 'a', 'e', 'b'],
['a', 'b', 'c', 'a', 'a', 'a', 'b', 'b'],
['a', 'b', 'c', 'a', 'a', 'c', 'b', 'b'],
['a', 'c', 'a', 'c', 'a', 'd', 'b', 'b'],
@willmcneilly
willmcneilly / issue_to_pull_request_conversion.sh
Created January 27, 2014 15:36
Issue to pull request conversion with hub
git push -u origin <branchname>
git pull-request -i <issue number>

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@willmcneilly
willmcneilly / push_new_branch_to_remote.sh
Created January 20, 2014 15:24
Push a new local branch to remote
$ git checkout -b mynewfeature
$ git push -u origin mynewfeature
@willmcneilly
willmcneilly / _.md
Created January 20, 2014 00:13
prototype: d3.geo