This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80 default_server; | |
server_name _; | |
return 444; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function observer(){ | |
var observers = []; | |
return {notify: notify, subscribe:subscribe} | |
function subscribe(callback){ | |
observers.push(callback); | |
var i = observers.length - 1; | |
return function(){ | |
observers[i] = function(){} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/.gitignore b/.gitignore | |
index e2aa052..9a467fb 100644 | |
--- a/.gitignore | |
+++ b/.gitignore | |
@@ -5,12 +5,12 @@ | |
# git config --global core.excludesfile ~/.gitignore_global | |
# Ignore bundler config | |
-/.bundle | |
+.bundle/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Fixtures($) { | |
var id, container; | |
function setup(files) { | |
for(var i = 0; i < files.length; i++) { | |
load(files[i]) | |
} | |
} | |
function createContainer() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GoalsController < ApplicationController | |
respond_to :html, :json | |
before_action :set_goal, only: [:show, :edit, :update] | |
def show | |
respond_with @goal | |
end | |
def edit | |
respond_with @goal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ls='ls -F' | |
alias ll='ls -l' | |
alias la='ls -A' | |
alias l='ls -CF' | |
alias lsa='ls -al' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"color_scheme": "Packages/Color Scheme - Default/SpaceCadet.tmTheme", | |
"default_line_ending": "unix", | |
"draw_white_space": "all", | |
"ensure_newline_at_eof_on_save": true, | |
"font_size": 15.0, | |
"highlight_column": true, | |
"highlight_line": true, | |
"highlight_modified_tabs": true, | |
"show_tab_close_buttons": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostPolicy < Struct.new(:user, :post) | |
def update? | |
post.user == user | |
end | |
def destroy? | |
false | |
end | |
def show? | |
true | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Proc | |
def bind(receiver) | |
unbound_method = receiver.class.unbound_method self | |
unbound_method.bind receiver | |
end | |
end | |
class Object | |
def self.unbound_method(proc) | |
define_method :__temp_unbound_method__, &proc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Node = Struct.new(:value, :left, :right) | |
node = Node.new(24, Node.new(12, Node.new(10), Node.new(14)), Node.new(28, nil, Node.new(30))) | |
def values(node) | |
return [] if node.nil? | |
[values(node.left), | |
node.value, | |
values(node.right)].flatten | |
end |
NewerOlder