Skip to content

Instantly share code, notes, and snippets.

View fractaloop's full-sized avatar

Logan Lowell fractaloop

  • Apple, Inc.
  • Austin, TX
View GitHub Profile
@fractaloop
fractaloop / battle.js
Last active July 2, 2016 22:20 — forked from chrisinajar/battle.js
Battle whitelist for screeps
var USERNAME_WHITELIST = ['chrisinajar', 'ho0ber', 'fractaloop', 'n7-anthony', 'overra', 'tyrel', 'fervens'];
module.exports = {
findEnemy: findEnemy,
run: run
};
/*
var target = findEnemy(creep);
*/
@fractaloop
fractaloop / battle.js
Created July 2, 2016 22:18 — forked from ho0ber/battle.js
Battle whitelist for screeps
// usernames are all lowercase, we compare with to lower
var USERNAME_WHITELIST = ['chrisinajar', 'ho0ber', 'fractaloop', 'n7-anthony', 'overra', 'tyrel', 'fervens'];
module.exports = {
findEnemy: findEnemy
};
/*
var target = findEnemy(creep);
*/

Start the server and send a request.

curl localhost:9000/123

The server will print:

/123/123

{
"flow": {
"_id": 1001,
"name": "Twitter",
"stages": [
{
"_id": 2001,
"flow_id": 1001,
"name": "Reader"
},
@fractaloop
fractaloop / flow.js
Created July 31, 2012 16:57
ember.js relationship-improvements test
//= require_tree ./templates
(function() {
App = Em.Application.create({
rootElement: '#flow'
})
@fractaloop
fractaloop / gist:3218314
Created July 31, 2012 16:34
ember-data relationship mappings
App.store = DS.Store.create({
revision: 4,
adapter: DS.RESTAdapter.create({
serializer: DS.Serializer.create({
primaryKey: function(type) { return '_id'; }
}),
mappings: {
'flow': Flow.Flow
}
})
@fractaloop
fractaloop / metaserver.rb
Created December 14, 2011 23:01
Rails 3.1 Sinatra streaming question...
require 'sinatra'
require 'thin'
class Metaserver < Sinatra::Base
set server: 'thin'
set connections: []
get '/stream', provides: 'text/event-stream' do
stream :keep_open do |out|
settings.connections << out
@fractaloop
fractaloop / Currency Exchange.html
Created January 11, 2011 14:07
Exchange Rates as of 1/11/2011 - World of Warcraft Gold is #100
Rank Currency Code USD Units Per USD
1 Platinum (oz.) XPT 1747 0
2 Gold (oz.) XAU 1372.15 0
3 Palladium (oz.) XPD 768 0
4 Silver (oz.) XAG 28.9052 0.03
5 Kuwaiti Dinar KWD 3.5521 0.28
6 Bahraini Dinar BHD 2.6618 0.38
7 Omani Rial OMR 2.6078 0.39
8 Latvian Lats LVL 1.8444 0.54
9 St. Helena Pound SHP 1.5588 0.64