Skip to content

Instantly share code, notes, and snippets.

@daveltr
daveltr / content.coffee
Created August 23, 2012 02:37 — forked from quangv/content.coffee
Controller-scoped routes using Spine.js
require('spine/lib/manager')
class Main extends Spine.Stack
routes:
'adventure': 'adv'
'home': 'home'
'information': 'info'
controllers:
info: Information
home: Home
App.FindPartiesService = Em.Object.extend
init: ( check=@.get('check') ) ->
@_super()
@check=check
throw "No Check Provided" unless @check
@getPartiesFromCheck()
getPartiesFromCheck: (check=@check) ->
@parties=check.get('parties')
@parties
@daveltr
daveltr / datepicker.js
Created March 4, 2013 20:12
bootstarp datepicker
/* =========================================================
* bootstrap-datepicker.js
* http://www.eyecon.ro/bootstrap-datepicker
* =========================================================
* Copyright 2012 Stefan Petre
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@daveltr
daveltr / datepicker.css
Created March 4, 2013 20:14
bootstrap datepicker
/*!
* Datepicker for Bootstrap
*
* Copyright 2012 Stefan Petre
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*/
.datepicker {
top: 0;
// Last commit: 2bcc767 (2013-03-07 17:07:46 -0800)
(function() {
window.DS = Ember.Namespace.create({
// this one goes past 11
CURRENT_API_REVISION: 12
});
})();
@daveltr
daveltr / test.css
Last active December 16, 2015 02:39
#test3 {
background-color: black;
}
App.AccountEditRoute = Ember.Route.extend({
setupController: function(controller) {
controller.set('content', this.get('currentUser'));
}
});

Standard Competition Rankings

This class makes it easier to generate a leaderboard that complies with the Standard Competition Ranking system. That is, it takes joint/tied positions into account, and adjusts the positions accordingly.

Take the following list of users and points for example:

User    | Points
1         35
2         35
=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')
@daveltr
daveltr / extract_sbf_proof.rb
Created December 25, 2013 15:23
proof of concept extraction of binary data from SBF files.
require 'bindata'
BLOCK_SIZE = 64
class SbfHeader < BinData::Record
endian :little
uint32 :dchain
uint32 :dcount
uint32 :serial