Skip to content

Instantly share code, notes, and snippets.

View allenluce-zz's full-sized avatar

Allen Luce allenluce-zz

  • Substantial
  • Seattle
View GitHub Profile
@allenluce-zz
allenluce-zz / gist:2705488
Created May 15, 2012 22:03
Pre-clipped and Canvas-clipped stroke performance testing
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
var WIDTH = 500;
var HEIGHT = 500;
function drawoutline(id) {
var el = $(id);
var ctx = el[0].getContext('2d');
beforeEach ->
@broadcasterMethods = jasmine.createSpy()
@messageBroadcaster =
strokeBegin: @broadcasterMethods
strokeContinue: @broadcasterMethods
strokeEnd: @broadcasterMethods
....
it "should return early", ->
def timeIt(comment, &code)
retValue = nil
time = Benchmark.realtime do
retValue = code.call
end
puts "#{comment}: %.2fms" % (time*1000)
retValue
end
@allenluce-zz
allenluce-zz / gist:3191199
Created July 28, 2012 00:31
Commit 07b0e595
commit 07b0e595d0c35bea2476a499161785cdc1204864
Author: Alex May <[email protected]>
Date: Wed Mar 28 14:54:01 2012 -0700
use context's topics, not contents
diff --git a/src/opencore/opencore/models/contentfeeds.py b/src/opencore/opencore/models/contentfeeds.py
index 51de399..4a71ee3 100644
--- a/src/opencore/opencore/models/contentfeeds.py
+++ b/src/opencore/opencore/models/contentfeeds.py
@allenluce-zz
allenluce-zz / gist:3191201
Created July 28, 2012 00:32
Commit 3c24d247
commit 3c24d247ec2fc421cfdf05f53314284634307542
Author: Alex May <[email protected]>
Date: Sun Apr 15 13:02:00 2012 -0700
set sane limits on stack size
- we know that stacks of size 10k+ cannot be iterated through
quickly enough to serve web requests
diff --git a/src/opencore/opencore/models/contentfeeds.py b/src/opencore/opencore/models/contentfeeds.py
@allenluce-zz
allenluce-zz / gist:3191202
Created July 28, 2012 00:32
Commit 799b2c7d
commit 799b2c7debb78643eec2afcd4691f334f5486a10
Author: Alex May <[email protected]>
Date: Tue Mar 20 13:50:34 2012 -0700
bump up event stack size
- should be enough to hold 1 year's worth of events now
diff --git a/src/opencore/opencore/models/contentfeeds.py b/src/opencore/opencore/models/contentfeeds.py
index 243c841..e6f6747 100644
require "mechanize"
require "benchmark"
story = "my-cow-ate-my-homework"
env = :staging
urls = {
:staging => 'http://hcd-connect-staging.herokuapp.com/stories/',
:devel => 'http://127.0.0.1:6544/stories/'
}
On the project view:
+ Can you confirm that these are new, additional data that we will
collect from the user, keep associated with a project, and allow the
owning user to edit?
- Project Title
- Project photo
- Project location
- Project description
- Focus area association
- Twitter hash tags associated with this project
(working db)
zodb=# \z public.current_object
Access privileges
Schema | Name | Type | Access privileges | Column access privileges
--------+----------------+-------+-------------------+--------------------------
public | current_object | table | |
(failing db)
from repoze.lemonade.content import create_content
from opencore.models.interfaces import IProfile
from opencore.security.policy import to_profile_active
groups = ('group.KarlStaff',)
lastname = "Reynolds"
email = "[email protected]"
users = root.users
profiles = root['profiles']