Skip to content

Instantly share code, notes, and snippets.

@jcorcuera
jcorcuera / gist:0dd109cbb533272ddf36bf3d4a403c14
Created April 3, 2017 16:46 — forked from bibstha/gist:49540af53fa0ec5ab869
Deploy to dokku from codeship.com

After migrating from heroku to dokku, we had to also chance codeship so we deploy to dokku. I followed the following steps to successfully deploy to dokku.

  1. Save the public key of the codeship project. It is found in Project Settings > General Settings.
  2. Copy the public key to a file /tmp/codeship_projectname.pub.
  3. Make sure when pasting, all the contents are in a single line and not multiple lines.
  4. Add the public key to dokku using the following command in console. Reference.
cat /tmp/codeship_projectname.pub | ssh root@yourdokkuinstance "sudo sshcommand acl-add dokku [description]"
@jcorcuera
jcorcuera / import-github-labels.js
Created March 12, 2017 20:29 — forked from Isaddo/import-github-labels.js
import github labels via console command
/*
Go on your labels page (https://github.com/user/repo/labels)
Edit the following label array
or
Use this snippet to export github labels (https://gist.github.com/MoOx/93c2853fee760f42d97f)
and replace it
Paste this script in your console
Press Enter!!
@jcorcuera
jcorcuera / gist:3803071
Created September 29, 2012 03:34 — forked from chrismdp/gist:2768532
Paypal IPN integration in about 30 lines of Sinatra.
diff --git a/app/account.rb b/app/account.rb
index a108685..c89ad34 100644
--- a/app/account.rb
+++ b/app/account.rb
@@ -1,4 +1,22 @@
+require 'open-uri'
+
module Sol
+ class Url
+ def self.get(url)
@jcorcuera
jcorcuera / bootstrap_pagination_helper.rb
Created June 15, 2012 14:12 — forked from oparrish/bootstrap_pagination_helper.rb
Link renderer to be used with will_paginate to render links to work with Twitter Bootstrap
module BootstrapPaginationHelper
class LinkRenderer < WillPaginate::ActionView::LinkRenderer
protected
def page_number(page)
unless page == current_page
link(page, page, :rel => rel_value(page))
else
link(page, "#", :class => 'active')
end
@jcorcuera
jcorcuera / callbacks.rb
Created October 25, 2011 16:48
capistrano pre-compile assets for rails 3.1
desc "precompile the assets"
task :precompile_assets, :roles => :web, :except => { :no_release => true } do
run "cd #{current_path}; rm -rf public/assets/*"
run "cd #{current_path}; RAILS_ENV=production bundle exec rake assets:precompile"
end
@jcorcuera
jcorcuera / about.md
Created August 9, 2011 14:26 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")