Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<body>
<script>
var parseQueryString = function( queryString ) {
var params = {}, queries, temp, i, l;
// Split into key/value pairs
queries = queryString.split("&");
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);
})
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
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 });
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;
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 })
})
@JFickel
JFickel / bootstrap_modals.js
Last active August 29, 2015 13:57
EmberJS Bootstrap Modal Question
// 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'
});
}
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
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
{"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