Skip to content

Instantly share code, notes, and snippets.

View ctide's full-sized avatar

Chris Burkhart ctide

View GitHub Profile
@ctide
ctide / HTML.md
Last active August 29, 2015 14:27
HTML Lesson

Every HTML page we make here will follow the same pattern:

<!DOCTYPE html>
<html>
</html>
  1. Doctype - tells the browser which version of HTML we are using. We will only be writing modern HTML, so we only need DOCTYPE html.
def balance(chars: List[Char]): Boolean = {
val l = '('
val r = ')'
def helper(left: Int, right: Int, c: List[Char]): Boolean = {
if (c.isEmpty)
(left - right) == 0
else {
if (right > left) false
@ctide
ctide / gist:5267734
Last active December 15, 2015 13:29 — forked from anonymous/gist:5267731
def pascal(c: Int, r: Int): Int = {
if (r < 1 || c < 1 || (c == r)) 1 // handles top of the triangle, and the sides
else pascal(c - 1, r - 1) + pascal(c, r - 1)
}
def pascal(c: Int, r: Int): Int = {
if (c == 0 || r == 0 || r == c) 1 else pascal(c - 1, r - 1) + pascal(c, r - 1)
}
@ctide
ctide / my_class.rb
Created September 20, 2012 01:42 — forked from moxley/my_class.rb
Weird Ruby Behavior
class MyClass
def value
"VALUE!"
end
def do_something
puts defined?(value) # Outputs "method"
puts value # Outputs "VALUE!"
if false
value = 'abcdef' # Should not execute
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"identifier = %d", 5, nil];
[Channel objectsWithPredicate: predicate];
{
"channels": [
{
"number": 78,
"name": "Zombie Bass",
"num_of_listeners": 1,
"created_at": "2012-03-21T04:04:36Z",
"updated_at": "2012-04-20T01:21:12Z"
},
]