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
jruby-1.7.10 |
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
[ | |
{ | |
"repo":{ | |
"id":11757750, | |
"owner":"facebook", | |
"name":"huxley", | |
"url":"https://github.com/facebook/huxley", | |
"homepage":null, | |
"language":"Python", | |
"description":"Watches you browse, takes screenshots, tells you when they change." |
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
def input_get | |
input = gets.chomp | |
sum[i] = input.to_i | |
end | |
def sum | |
sum = [] | |
i = 0 | |
puts input_get | |
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
def my_fancy_method | |
# Call the block with 1 | |
yield 1 | |
# Call the block with "cat" | |
yield "cat" | |
# Call the block with nothing (i.e. nil) | |
yield | |
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
Date::beginningOfMonth = -> | |
beginningOfMonth = @beginningOfDay() | |
beginningOfMonth.setDate(1) | |
beginningOfMonth | |
Date::endOfMonth = -> | |
endOfMonth = @endOfDay() | |
endOfMonth.setMonth(endOfMonth.getMonth() + 1) | |
endOfMonth.setDate(0) | |
endOfMonth |
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
BootModel = Mongoose.model "Boot", new Schema | |
laces: Number | |
tied: Boolean | |
class Boot extends BootModel | |
boot = new Boot | |
boot.laces = 4 | |
boot.tied = true |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Overflow!</title> | |
<style type="text/css"> | |
#outer { | |
height: 200px; | |
position: relative; | |
overflow: hidden; | |
background-color: red; |
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
require 'dcell/explorer' | |
DCell::Explorer.supervise("127.0.0.1", 8000) |
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
projects $ lein -v | |
Leiningen 2.0.0-preview7 on Java 1.6.0_33 Java HotSpot(TM) 64-Bit Server VM | |
projects $ lein new test | |
Generating a project called test based on the 'default' template. | |
To see other templates (app, lein plugin, etc), try `lein help new`. | |
projects $ cd test/ | |
projects $ vim project.clj | |
test $ cat project.clj | |
(defproject test "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" |
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 Admin < ActiveRecord::Base | |
attr_accessor :invite | |
devise :database_authenticatable, :registerable, :recoverable, :rememberable, | |
:trackable, :validatable | |
def self.new_invited(attributes) | |
new(attributes.merge(invite: true)) | |
end |
OlderNewer