Skip to content

Instantly share code, notes, and snippets.

View joncode's full-sized avatar
🏠
Launching Apps

Jon Anders joncode

🏠
Launching Apps
  • Agent1 / Suma / Squad.fyi / Splice / Lucera / Couchtour.tv / Hedera / Giftlocal / Sarson Funds / Dial / Manifest.ai
  • Philadelphia, PA
View GitHub Profile
@joncode
joncode / gist:5594304
Last active January 12, 2017 23:18
STAGING environment creation
1. make staging.rb in config/environments - copy production.rb for starters
2. in database.yml , application.yml , cloudinary.yml ... any .yml file , copy the production block and name it staging
2b. if you are using Resque - make a staging env in initializers/resque.rb
2c. add staging constants for any system-wide URLs
3. heroku create --remote staging <staging_app_name> --addons [any add ons here].
create the staging area of the config file
<staging_app_name> is the part of the url before '.herokuapp.com' -- muy importante , dont forget
4. heroku config:add RACK_ENV=staging RAILS_ENV=staging --remote staging
set up the rails environment vars
5. git push staging master
@joncode
joncode / gist:5622182
Created May 21, 2013 18:39
Resque - Redis
resque-web --- launch the web inteface
to have Resque available on the website :
mount the Resque::Server to the routes
add the server requirement to the resque gem
add HTTP authentication to the Resque::Server
@joncode
joncode / gist:5645816
Created May 24, 2013 19:08
EXC_BAD_ACCESS
fix with build edit scheme > diagnostics > enable NS zombie objects
will put a zombie (blank) object where the missing objet is and give you a error msg as to where the problem is

Let’s assume we have an existing project called ‘foo’ and we want to create a fork called ‘bar’.

First, create a new project on GitHub called ‘bar’.

Next, clone foo using the name ‘bar’:

$ git clone git@github.com:YOURNAME/foo.git bar
$ cd bar

Next, edit your Git config file and replace the origin URL with your new URL:

@joncode
joncode / gist:5689030
Last active December 17, 2015 23:29
Deploying a Rails 4 application / with ruby 2 / foundation 4 / secret ENV variable / staging area

basic setup


tasks:

  1. set up rvm gemset environment

    rvm --rvmrc --create 2.0.0@global

  2. run rails new

    rails new mdot

  3. change gemfile to specifically ask for ruby 2.0

@joncode
joncode / gist:5818017
Created June 19, 2013 21:03
to look at a table scheme in PG in heroku && change a table type Production or Staging --- POSTGRESQL
1. first run the pg version of dbconsole in heroku by using this command :
heroku pg:psql --remote heroku (<staging>)
2. list the tables in psql by using this command
\dt
3. get the proper name of the table and list the schema by using this command
@joncode
joncode / gist:6082450
Created July 25, 2013 18:31
LINKS that popup new windows and new tabs !
<%= link_to "NEW TAB", merchants_path, :target => '_blank' %>
<%= link_to "POPUP!",
merchants_path,
:onclick=>"window.open(this.href,'popup_form', 'height=371, width=460, top=200px, left=100px, directories=no, location=no, menubar=no, status=no, titlebar=no, toolbar=no, status=no');return false;" %>
@joncode
joncode / gist:6160888
Last active December 20, 2015 16:19
Removing any SECRET_TOKEN from source control
1. make a new secret token at the command line
rake secret
2. set the var in staging and production, run for each
heroku config:set SECRET_TOKEN=9813745901y30fhi2304ify1034yf1083y5r013yfr0813gf9 --remote <stagingORproduction>
3. remove the secret_token.rb code in favor of the GETTER for ENV['SECRET_TOKEN"]
YourAPP::Application.config.secret_key_base = if Rails.env.development? or Rails.env.test?
"3eb6db5a9026c547c72708438d496d942e976b252138db7e4e0ee5edd7539457d3ed0fa02ee5e7179420ce5290462018591adaf5f42adcf855da04877827def2"
else
@joncode
joncode / gist:6274015
Last active December 21, 2015 07:49
Attachinary how to add ...

Setup


  1. add the cloudinary and attachinary Rails 4 gems

    gem 'cloudinary'

    gem 'attachinary', git: 'git://github.com/rochers/attachinary.git', branch: 'rails4'

@joncode
joncode / gist:6300104
Last active December 21, 2015 11:38
Creating a .CSR and making a domain SSL