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"
},
]
Started GET "/" for 127.0.0.1 at 2012-01-22 16:36:51 -0800
Processing by IndexController#index as HTML
Rendered notifications/_notifications.html.haml (1.3ms)
Rendered items/_search.html.haml (0.8ms)
Rendered items/_todo_item.haml (0.0ms)
Rendered users/_todo.html.haml (2.1ms)
Rendered index/dashboard.html.haml within layouts/application (11.5ms)
Rendered layouts/_alert.html.haml (0.2ms)
Rendered layouts/_js_vars.html.haml (0.2ms)
Completed 200 OK in 16ms (Views: 14.3ms | ActiveRecord: 0.9ms)
set nocompatible
set number
set ruler
syntax on
" Shit i added:
set hidden
set history=1000
runtime macros/matchit.vim
set scrolloff=3
@ctide
ctide / player.rb
Created January 7, 2012 01:54
Intermediate ruby warrior code, hideous mess since I never bothered to refactor anything
class Player
attr_accessor :directions, :fled, :inverse
def initialize
@directions = [:forward, :left, :right, :backward]
@inverse = {:forward => :backward, :left => :right, :right => :left, :backward => :forward}
@fled = false
end
def play_turn(warrior)
21 Dec 21:41:44 - info: dashboardv3 started at pid 147, running startup callbacks.
[dashboardv3]
[dashboardv3] events.js:45
[dashboardv3] throw arguments[1]; // Unhandled 'error' event
[dashboardv3] [dashboardv3] [dashboardv3] ^
[dashboardv3] Error: EROFS, Read-only file system '/tmp/83556e2559a9f9e47147fcf84b6c9f85.png'
21 Dec 21:41:44 - info: dashboardv3 process has ended. (1:null)