Skip to content

Instantly share code, notes, and snippets.

View gpbmike's full-sized avatar
👋

Mike Horn gpbmike

👋
View GitHub Profile
skin: function (skinUrl, bgColor, contentWrapColor) {
var bgStyle = 'url(' + skinUrl + ') top center no-repeat ';
$('over_skin').setStyle("background", bgStyle + bgColor);
if (contentWrapColor) {
$('content-wrap').setStyle("background", contentWrapColor);
}
},
@gpbmike
gpbmike / create_best_of_category.py
Created March 14, 2012 04:32 — forked from cooncesean/create_best_of_category.py
Create a 'Best Of' article Category for Tested.
from ella.core.models import *
article_cat = Category.objects.get(slug='news')
Category.objects.create(slug='best-of', title='Best Of', tree_path='news/best-of', tree_parent=article_cat, site_id=1)
import datetime
import scout.recon.register
from django.contrib.auth.models import User
u = User.objects.get(username='')
u.profile['plan_id'] = 2
u.profile['next_billing_date'] = datetime.date(2012, 9, 1)
u.save()
YOUR_USERNAME = 'gpbmike'
import scout.recon.register
from django.contrib.auth.models import User
u = User.objects.get(username=YOUR_USERNAME)
u.profile['plan_id'] = 2
u.profile['next_billing_date'] = '2012-09-01'
u.save()
<section class='container-fixed'>
<section class='row'>
<section class='span4'>one</section>
<section class='span4'>two</section>
<section class='span4'>three</section>
</section>
</section>
@gpbmike
gpbmike / gist:2475315
Created April 24, 2012 01:29
mgmt commands
./manage.py loaddata category_data
./manage.py create_dev_topic_data
./manage.py create_dev_comment_data
1335396689.769749 [0 127.0.0.1:54898] "MULTI"
1335396689.769790 [0 127.0.0.1:54898] "EXEC"
1335396689.769802 [0 127.0.0.1:54898] "DEL" "promo:test:list"
1335396689.769820 [0 127.0.0.1:54898] "RPUSH" "promo:test:list" "promo:1"
1335396689.769843 [0 127.0.0.1:54898] "ZADD" "promo:streams" "1335396689.768909" "test"
1335396689.772833 [0 127.0.0.1:54898] "LRANGE" "promo:test:list" "0" "-1"
1335396689.773139 [0 127.0.0.1:54898] "MULTI"
1335396689.773271 [0 127.0.0.1:54898] "EXEC"
1335396689.773283 [0 127.0.0.1:54898] "HGETALL" "promo:1"
=== REDIS BUG REPORT START: Cut & paste starting from here ===
[4611] 01 May 09:25:21 # === ASSERTION FAILED ===
[4611] 01 May 09:25:21 # ==> rdb.c:890 'len == 0' is not true
[4611] 01 May 09:25:21 # (forcing SIGSEGV to print the bug report.)
[4611] 01 May 09:25:21 # Redis 2.9.5 crashed by signal: 11
[4611] 01 May 09:25:21 # Failed assertion: len == 0 (rdb.c:890)
[4611] 01 May 09:25:21 # --- STACK TRACE
[4611] 01 May 09:25:21 # 1 redis-server 0x0000000102a25c55 _redisAssert + 165
[4611] 01 May 09:25:21 # 2 ??? 0x5800000000000023 0x0 + 6341068275337658403
[4611] 01 May 09:25:21 # 3 redis-server 0x0000000102a117c1 rdbLoadObject + 1281
(momme)Garden:momme (master) $ ./manage.py migrate
Running migrations for site:
- Migrating forwards to 0003_add_listbliss_categories.
> site:0002_add_year_data_to_lifestages
Traceback (most recent call last):
File "./manage.py", line 12, in <module>
execute_from_command_line(sys.argv)
File "/Users/gpbmike/.virtualenvs/momme/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/Users/gpbmike/.virtualenvs/momme/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
<div class='col'>
<input id='canonical'><br>
<select name="categories" id="fake-categories" multiple="multiple">
<option value="1">Food</option>
<option value="2" data-parent-id='1'>Baby Food</option>
<option value="3" data-parent-id='1' selected="selected">Health</option>
<option value="4" data-parent-id='1' selected="selected">McDonalds</option>
<option value="5">Fun</option>
<option value="6" data-parent-id='5'>Potty Training</option>
<option value="7" data-parent-id='5'>Poop Central</option>