Skip to content

Instantly share code, notes, and snippets.

View resistorsoftware's full-sized avatar

David Lazar resistorsoftware

View GitHub Profile
import { Controller } from '@hotwired/stimulus'
export default class extends Controller {
static targets = ['launcher']
initialize () {
this.launchModal = this.launchModal.bind(this)
}
connect () {
@resistorsoftware
resistorsoftware / export_import_heroku_database.md
Created May 6, 2021 14:28 — forked from zulhfreelancer/export_import_heroku_database.md
How to export Heroku Postgres Database to Localhost Database (Rails)?

How to export Heroku Postgres Database to Localhost Database (Rails)?

Step 1

$ cd /path/to/your/rails/app
$ heroku pg:backups capture
$ curl -o latest.dump `heroku pg:backups public-url`

OR
@resistorsoftware
resistorsoftware / aa_instructions.md
Created May 2, 2012 04:14 — forked from NZKoz/aa_instructions.md
Back Up All Your Gmail
  • Install getmail (aptitude install getmail4)
  • Set Up Your Imap Server (tl;dr)
  • getmail
  • ruby date_based_archive.rb ~/Maildir/.Archive
@resistorsoftware
resistorsoftware / ShopifyAPICallLimit.rb
Created May 15, 2011 14:27 — forked from christocracy/ShopifyAPICallLimit.rb
Hacking ActiveResource::Connection for Shopify API in order to read HTTP response header 'http_x_shopify_api_call_limit'. Simply require this code after your gems have been loaded. Caveat emptor: This hack modifies a private method of AR::Connection; H
class ActiveResource::Connection
# HACK 1: Add an attr_reader for response
attr_reader :response
def request(method, path, *arguments)
result = ActiveSupport::Notifications.instrument("request.active_resource") do |payload|
payload[:method] = method
payload[:request_uri] = "#{site.scheme}://#{site.host}:#{site.port}#{path}"
payload[:result] = http.send(method, path, *arguments)
end
@resistorsoftware
resistorsoftware / ShopifyAPICallLimit.rb
Created May 14, 2011 16:01 — forked from christocracy/ShopifyAPICallLimit.rb
Hacking ActiveResource::Connection for Shopify API in order to read HTTP response header 'http_x_shopify_api_call_limit'. Simply require this code after your gems have been loaded.
class ActiveResource::Connection
# HACK 1: Add an attr_reader for response
attr_reader :response
def request(method, path, *arguments)
result = ActiveSupport::Notifications.instrument("request.active_resource") do |payload|
payload[:method] = method
payload[:request_uri] = "#{site.scheme}://#{site.host}:#{site.port}#{path}"
payload[:result] = http.send(method, path, *arguments)
end
#
# Create a new repo on Github and directly push your initial commit with this shell script
#
url=https://github.com/api/v2/json/repos/create
username=$(git config github.user)
token=$(git config github.token)
name=${1-$(basename $(pwd))}
curl -F login=$username -F token=$token $url -F name=$name -F public=1 1>/dev/null