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
<!DOCTYPE html> | |
<html> | |
<body> | |
<script> | |
var parseQueryString = function( queryString ) { | |
var params = {}, queries, temp, i, l; | |
// Split into key/value pairs | |
queries = queryString.split("&"); |
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
var WebSocketServer = require('ws').Server; | |
var http = require('http'); | |
var port = process.env.PORT || 5000; | |
var server = http.createServer(); | |
// this does nothing | |
server.on('request', function(req, res) { | |
console.log("HEADERS SHOULD BE HERE?") | |
console.log(req.headers); | |
}) |
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
attr = DS.attr; | |
function shuffle(o){ | |
for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); | |
return o; | |
}; | |
Gameway.Bracket = DS.Model.extend({ | |
// tournamnetId formatting wasn't being picked up for some reason by the serializer | |
// it looks like i'll have to refer to it in this format |
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
for (matchIndex = 0; matchIndex < matchCount; matchIndex++) { | |
isMatchIndexEven = matchIndex % 2 ? undefined : true; | |
nextMatchIndex = Math.floor(matchIndex/2); | |
nextRoundIndex = this.roundCount() - reverseIndex; | |
builtRounds.findBy('index', nextRoundIndex).get('matches').then(function(matches) { | |
return matches.findBy('index', nextMatchIndex); | |
}).then(function(nextMatch) { | |
nextMatch.get('matchups').then(function(matchups) { | |
nextMatchup = matchups.findBy('top', isMatchIndexEven); | |
match = thisStore.createRecord('match', { index: matchIndex, nextMatchupId: nextMatchup.get('id'), round: round }); |
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
attr = DS.attr; | |
Gameway.Tournament = DS.Model.extend({ | |
name: attr('string'), | |
bracketId: attr('string'), | |
bracket: function() { | |
this.store.find('bracket', this.get('bracketId')).then(function(bracket) { | |
debugger; | |
}, function(error) { | |
debugger; |
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
attr = DS.attr; | |
Gameway.User = DS.Model.extend({ | |
name: attr('string'), | |
email: attr('string'), | |
lolAccount: DS.belongsTo('lolAccount'), | |
avatarUrl: attr('string'), | |
teams: DS.hasMany('team', { async: true }) | |
}) |
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
// I'm using a cookbook recipe from http://emberjs.com/guides/cookbook/user_interface_and_interaction/using_modal_dialogs/ | |
// I've got this action in my Ember.ApplicationRoute: | |
openModal: function() { | |
this.render("processing", { | |
into: 'application', | |
outlet: 'modal' | |
}); | |
} |
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
require 'benchmark' | |
def multiples(end_of_range) | |
multiple_sum = 0 | |
multiples_of_three = 0 | |
while multiples_of_three < end_of_range | |
multiple_sum += multiples_of_three | |
multiples_of_three += 3 | |
end |
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
require 'spec_helper' | |
feature 'delphius user creates a chart of accounts' do | |
scenario "successfully", js: true do | |
sign_in_as_delphius_user | |
chart_of_accounts = new_chart_of_accounts | |
chart_of_accounts.create | |
chart_of_accounts.has_been_created | |
end |
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
{"users":[{"id":18,"username":"test.username16","first_name":"first16","last_name":"last16","full_name":"first16 last16","avatar_url":"https://gameway-development.s3.amazonaws.com/uploads/user/avatar/18/icon_3fe2ce9a0873256e4edc99d9f785180a.png","user_url":"/users/18","lol_account":null,"starcraft2_account":{"id":null,"url":null,"host":null,"locale":null,"realm":null,"character_name":null,"profile_id":null,"user_id":null,"created_at":null,"updated_at":null}},{"id":2,"username":"test.username0","first_name":"first0","last_name":"last0","full_name":"first0 last0","avatar_url":"https://gameway-development.s3.amazonaws.com/uploads/user/avatar/2/icon_81972f31641c36c6964520fbd03e2f0d.png","user_url":"/users/2","lol_account":null,"starcraft2_account":{"id":null,"url":null,"host":null,"locale":null,"realm":null,"character_name":null,"profile_id":null,"user_id":null,"created_at":null,"updated_at":null}},{"id":3,"username":"test.username1","first_name":"first1","last_name":"last1","full_name":"first1 last1","avatar_url |
NewerOlder