Skip to content

Instantly share code, notes, and snippets.

View pbonnell's full-sized avatar

Peter B pbonnell

  • CIRCUIT LLC
View GitHub Profile
"super_admin"=>
["admin",
"content_create",
"content_edit",
"content_delete",
"category_create",
"category_edit",
"category_delete",
"page_create",
"page_edit",
file: _upload_params.json.erb
{
"auth": {
"key": "4d24e398cd344661a27f47f172ec3211"
}
, "template_id": "4d24ef08014047129610498c72ec3211"
, "steps":{
"export_thumb":{ "path": "peter_test/images/thumb/${file.original_id}_${file.urlName}"}
}
,"redirect_url":"/admin/galleries/upload/7"
hylo_harris[master*]/# heroku db:pull
Loaded Taps v0.3.14
Auto-detected local database: mysql://root@localhost/premier_harris?encoding=utf8
Warning: Data in the database 'mysql://root@localhost/premier_harris?encoding=utf8' will be overwritten and will not be recoverable.
! WARNING: Potentially Destructive Action
! This command will affect the app: harris
! To proceed, type "harris" or re-run this command with --confirm harris
> harris
<a class="rpxnow" href="https://janrain-engage-demo.rpxnow.com/openid/v2/signin?token_url=my%2Freturn%2Furl">Janrain( put a nice icon here)</a>
<script src="https://rpxnow.com/openid/v2/widget" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[

RPXNOW.token_url = 'my/return/url';
RPXNOW.realm = 'janrain-engage-demo';
RPXNOW.overlay = true;
 
 
 

//]]>

</script>

LocableCore[master]/# git remote add heroku git@heroku.com:premier-demo.git
LocableCore[master]/# git pull heroku master
warning: no common commits
^CKilled by signal 2.cts: 406
~/p# git clone git@heroku.com:premier-demo.git LocableDemo
Initialized empty Git repository in /Users/pb/p/LocableDemo/.git/
remote: Counting objects: 7378, done.
remote: Compressing objects: 100% (6136/6136), done.
remote: Total 7378 (delta 4193), reused 2286 (delta 732)
Receiving objects: 100% (7378/7378), 4.91 MiB | 297 KiB/s, done.
Resolving deltas: 100% (4193/4193), done.
~/p# cd LocableDemo
LocableDemo[master]/# git remote add core git@github.com:brianmba/LocableCore.git
LocableDemo[master]/# git remote show core
@pbonnell
pbonnell / AR updating in a migration!?
Created February 3, 2011 19:58
code runs fine in console, FAILS to update inside a migration
# drop this on console :
@new_names = {
"1" => {:label => "super_admin",:nicename => "Super Admin"},
"2" => {:label => "admin", :nicename => 'Admin'},
"3" => {:label => 'editor' , :nicename=>'Editor'},
"4" => {:label => 'columnist', :nicename => "Columnist"},
"5" =>{:label => 'guest', :nicename => "Guest"}
}
@pbonnell
pbonnell / template_wrapper_initializer.rb
Created March 28, 2011 19:24
rake installed initializer for template_wrapper gem
# install me : {Rails.root}/config/initializers/template_wrapper_initializer.rb
if defined?(TemplateWrapper)
## ALL VALUES HERE ARE DEFAULTS IF INITIALIZER IS NOT PRESNT
TemplateWrapper.default_rendering = :full
# :full (icon & text) || :icon (only) || :comment (wraps patial in source comments only) || :blank (do nothing)
TemplateWrapper.image_src = "http://circuitllc.com/template_wrapper/images/ruby_next.png"
# feel free to grab this from the circuit box for local serve, or use whatever you wish...
# => more images :
TemplateWrapper.href = {:link =>"NOT_IMPLEMENTED", :class => 'template_wrapper_link'}
@pbonnell
pbonnell / template_wrapper_initializer.rb
Created March 28, 2011 19:24
rake installed initializer for template_wrapper gem
# install me : {Rails.root}/config/initializers/template_wrapper_initializer.rb
if defined?(TemplateWrapper)
## ALL VALUES HERE ARE DEFAULTS IF INITIALIZER IS NOT PRESNT
TemplateWrapper.default_rendering = :full
# :full (icon & text) || :icon (only) || :comment (wraps patial in source comments only) || :blank (do nothing)
TemplateWrapper.image_src = "http://circuitllc.com/template_wrapper/images/ruby_next.png"
# feel free to grab this from the circuit box for local serve, or use whatever you wish...
# => more images :
TemplateWrapper.href = {:link =>"NOT_IMPLEMENTED", :class => 'template_wrapper_link'}
@pbonnell
pbonnell / notices_controller_spec.rb
Created June 24, 2011 20:33
this fails @ l.5 in SPEC ONLY - on dev/browser record after .save is identical to a dump in the test
it "should create a new notice", :real_db => true do
@_before = Admin::Notice.count
post :create, @post_params
Admin::Notice.should_receive(:create).with(@post_params).and_return(1)
Admin::Notice.count.should == @_before + 1 #<= FAILS HERE ?
response.should redirect_to('/admin/notices/info')
end
# SPEC FAIL :
# Failure/Error: Admin::Notice.count.should == @_before + 1