Skip to content

Instantly share code, notes, and snippets.

View aaronj1335's full-sized avatar
🤠

Aaron Stacy aaronj1335

🤠
View GitHub Profile
@aaronj1335
aaronj1335 / daft.astacy.yaml
Created November 5, 2012 14:37
uwsgi caching issue
uwsgi:
http-socket: 0.0.0.0:8001
master: true
processes: 1
module: spire.runtime.uwsgi
static-map: /static=static
Prelude> import qualified Control.Monad.State
Prelude Control.Monad.State> let fromStoAandS c | c `mod` 5 == 0 = ("foo",c+1) | otherwise = ("bar",c+1)
Prelude Control.Monad.State> let stateIntString = State fromStoAandS
<interactive>:6:22:
Not in scope: data constructor `State'
Perhaps you meant `Control.Monad.State.StateT' (imported from Control.Monad.State)
@aaronj1335
aaronj1335 / run_tests.py
Created December 12, 2012 15:02
run a bunch of front-end unit tests with csi
#!/usr/bin/env python
import webbrowser,subprocess
tests = subprocess.check_output('node_modules/.bin/csi test --listtests'.split())
# on windows
# tests = subprocess.check_output('node node_modules/csi/bin/proxy.js test --listtests'.split()'.split())
for test in tests.split('\n'):
webbrowser.open_new_tab(test)
@aaronj1335
aaronj1335 / modeljs_todos.md
Last active December 10, 2015 21:18
model.js todo

we need to cover some corner cases in model.js and add some caching so that it's easier to do good MVC design.

@ralphsmith80 and i went over some ideas, and came up with some notes:

  • Collection.prototype.load is cached by default, you can explicitly re-send the request with the {reload: true} parameter

  • Model.prototype.refresh on the other hand re-sends the request by default, and you can get a cached result by explicitly setting conditional: true

    • TODO: add Model.prototype.load that behaves like the collection method, essentially just calling refresh w/ the conditional flag set to true
    • TODO: when refresh is called and there is an in-flight request, just return the promise of the in-flight request
  • TODO: handle out-of-order responses

@aaronj1335
aaronj1335 / asconfigurable.js
Last active December 11, 2015 02:08
configurable widget
// this would live in auxl
define([
'vendor/jquery',
'configuration'
], function($, configuration) {
return function(options) {
var name = options.name;
this.configuration =
$.extend(true, this.configuration, configuration[name]);
};
@aaronj1335
aaronj1335 / binding.js
Last active December 11, 2015 04:09
data binding in gloss 2.0
var Binding = Class.extend({
prop: null, // required
twoWay: false,
// XOR of one of the following
// ------------------------------
widget: null,
// ------------------------------
$el: null,
@aaronj1335
aaronj1335 / bumpr.coffee
Created February 7, 2013 16:02
hoping to make this a bit more understandable...
commands =
stage: (config)->
if config.clobber and exists config.stagingdir
rm "-rf", config.stagingdir
mkdir "-p", config.stagingdir unless exists config.stagingdir
cloneAll(config)
report: (config)->
# first check if we need to clone the repos
preRequisites = if config.stagetoo then [commands.stage(config)] else []
@aaronj1335
aaronj1335 / todo.md
Last active December 13, 2015 17:19
development environment needs
## TODO - `butler bounce` command - generates csi static stuff in like `daft/templates` - generates the running .yaml config - reloads the server - watch file list - something that watches the yaml config files (there's now 3 of them) - `butler test` command -- essentially does what the [`ut`](https://github.com/siq/util/blob/master/bin/ut) script does now - `butler optimize` command -- same as `serve optimize`
@aaronj1335
aaronj1335 / index.html
Created February 22, 2013 15:09
A CodePen by Aaron Stacy.
<table>
<tr>
<td>
name
</td>
<td>
aaron
</td>
<td>
description
@aaronj1335
aaronj1335 / index.html
Created February 22, 2013 15:16
A CodePen by Aaron Stacy.
<table>
<tr>
<td>
name
</td>
<td>
aaron
</td>
<td>
description