This file contains hidden or 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
window.Dice || (window.Dice = {}); | |
Dice.roll = function(dice) { | |
let match = /(\d+)?d(\d+)(?:\+(\d+))?/.exec(dice); | |
if (match == null) { | |
return {}; | |
} | |
let number_of_dice = match[1] == undefined ? 1 : parseInt(match[1], 10); | |
let dice_size = parseInt(match[2], 10); | |
let modifier = match[3] == undefined ? 0 : parseInt(match[3], 10); |
This file contains hidden or 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
countdown = (eventdate, form) -> | |
cid = -1 | |
start = -> | |
cid = setInterval update, 500 | |
stop = -> | |
clearInterval cid | |
pad = (number, width = 2, z = '0') -> | |
number = "#{number}" | |
if number.length >= width | |
number |
This file contains hidden or 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 ImagesAsCheckboxes | |
constructor: (question_id, conditions = null) -> | |
@conditions = | |
debug: conditions && conditions['debug'] || false | |
exclusive: conditions && conditions['exclusive'] || false | |
randomize: conditions && conditions['randomize'] || false | |
grid: conditions && conditions['grid'] || false | |
static_last: conditions && conditions['static_last'] || false | |
selector = "span[id^=#{question_id}C]" | |
@question_id = question_id |
This file contains hidden or 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
jQuery(document).ready(function($){ | |
$.fancybox.open([ | |
{ | |
content : '<a id="ccfa_lander" href="http://ccteamchallenge.force.com/halfmarathon" target="_blank"><img src="<INSERT IMAGE URL HERE>" height="461" width="600"></a>' | |
} | |
], { | |
padding : 0 | |
}); | |
$('#ccfa_lander').click(function(event){ |
This file contains hidden or 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
$ bundle install --path vendor/gems --binstubs | |
Fetching source index from https://rubygems.org/ | |
Using rake (10.0.3) | |
Using i18n (0.6.2) | |
Using multi_json (1.6.1) | |
Using activesupport (3.2.12) | |
Using builder (3.0.4) | |
Using activemodel (3.2.12) | |
Using erubis (2.7.0) | |
Using journey (1.0.4) |
This file contains hidden or 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
➜ bundle install | |
Fetching gem metadata from https://rubygems.org/....... | |
Fetching gem metadata from https://rubygems.org/.. | |
Resolving dependencies... | |
Using rake (10.0.4) | |
Installing RedCloth (4.2.9) | |
Using i18n (0.6.1) | |
Using multi_json (1.7.3) | |
Using activesupport (3.2.13) | |
Using addressable (2.3.4) |
This file contains hidden or 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
$ bundle exec rspec spec/features/deleting_leagues_spec.rb | |
~/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/better_errors-0.3.2/lib/better_errors/core_ext/exception.rb:9: [BUG] Segmentation fault | |
ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-darwin12.2.1] | |
-- Control frame information ----------------------------------------------- | |
c:0061 p:---- s:0168 b:0168 l:000167 d:000167 CFUNC :callers | |
c:0060 p:0072 s:0165 b:0165 l:001870 d:0015a0 LAMBDA ~/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/better_errors-0.3.2/lib/better_errors/core_ext/exception.rb: | |
c:0059 p:---- s:0162 b:0162 l:000161 d:000161 FINISH | |
c:0058 p:---- s:0160 b:0160 l:000159 d:000159 CFUNC :new |
This file contains hidden or 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
javascript:(function(){var div,filler,link,names,video,videos,_i,_j,_len,_ref,__slice=[].slice,__indexOf=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};if(localStorage&&localStorage.getItem("watched_videos"))for(div='<div class="course-progress" data-width="100%" style="width: 100%;z-index: 0;"></div>',names=localStorage.getItem("watched_videos").split("|"),videos=$(".bucket-media"),_i=0,_len=videos.length;_len>_i;_i++)video=videos[_i],_ref=video.href.split("/"),filler=_ref.length>=2?__slice.call(_ref,0,_j=_ref.length-1):(_j=0,[]),link=_ref[_j++],__indexOf.call(names,link)>=0&&$(video).before(div)})(); |
This file contains hidden or 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 Prime | |
constructor: (@prime = 2) -> | |
@history = [@prime] | |
isPrime: (num) -> | |
result = true | |
if num isnt 2 | |
if num % 2 is 0 | |
result = false | |
else |
NewerOlder