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 TermsPdf < Prawn::Document | |
def initialize(application) | |
super() | |
@application = application | |
@listing = @application.listing | |
@host = @listing.organization | |
@guest = @application.guest_organization | |
font "Times-Roman" | |
default_leading 2 |
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 Anagram | |
attr_reader :source | |
attr_reader :match_chars | |
def initialize(source) | |
@source = source.downcase | |
@match_chars = self.source.split('').sort | |
end | |
def match(candidates) |
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
$('#tabs a').click(function() { | |
// Add prevent default | |
$('#tabs li').removeClass('active'); | |
$(this).parent().addClass('active'); | |
var tab_to_show = $(this).attr('href'); | |
$("#tabs_container").children().addClass('hidden'); | |
$(tab_to_show).removeClass('hidden'); | |
}); |
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
{"sessions":[{"conference_day":1,"start_time":"07:30","end_time":"09:15","title":"Registration","presenter":"","room_name":"Convention Registration","track_name":null},{"conference_day":3,"start_time":"15:50","end_time":"16:30","title":"Software Development Lessons from the Apollo Program","presenter":"Julian Simioni","room_name":"Ballroom 1-3","track_name":"Crafting Code"},{"conference_day":3,"start_time":"11:10","end_time":"11:50","title":"Front-End: Fun, Not Frustration","presenter":"Roy Tomeij","room_name":"Ballroom 5","track_name":null},{"conference_day":2,"start_time":"09:15","end_time":"10:20","title":"Announcements / Keynote","presenter":"Yehuda Katz","room_name":"Sheraton Ballroom","track_name":null},{"conference_day":4,"start_time":"13:30","end_time":"15:50","title":"Test Drive a Browser Game With JavaScript","presenter":"Zach Briggs, Todd Kaufman","room_name":"Superior","track_name":"Workshop"},{"conference_day":3,"start_time":"10:20","end_time":"11:10","title":"Morning Break","presenter":"","room_ |
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
-if hash_with_count.present? | |
-# Take a hash formated like so { :a => 2, :b => 4, :c => 6...}, sort it highest to lowest and slice up and iterate over each row. | |
- hash_with_count.sort_by{|k,v| v}.reverse.each_slice(5).to_a.each do |row| | |
%ul#tags.list-inline | |
-row.each do |name, count| | |
%li | |
.label.label-success | |
= name | |
= count | |
-else |
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
var connect = require('connect') | |
, exec = require('child_process').execFile | |
var app = connect() | |
.use(connect.json()) | |
.use(function(req, res) { | |
if (!!~ req.body.ref.indexOf('gh-pages')) | |
return res.end("OK"); | |
console.log("DEPLOYING...") |
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
#scroll{ | |
direction:rtl; | |
overflow:auto; | |
height:50px; | |
width:50px;} | |
#scroll div{ | |
direction:ltr; | |
} |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
// Two Column setup | |
// markup | |
%secion.content | |
%article | |
%section | |
%h1 Main section | |
%aside | |
%section |
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
var arr = [1,2,3,4]; | |
for (var i = 0, len = arr.length; i < len; i++) { | |
var el = arr[i]; | |
setTimeout(function () { | |
console.log(el); | |
}, 10); | |
} |
OlderNewer