Skip to content

Instantly share code, notes, and snippets.

View digerata's full-sized avatar

Mike Wille digerata

View GitHub Profile
require 'uri'
require 'net/http'
class ExampleController < ApplicationController
def test_smartline
url = URI("https://smartlinedesign.quickbase.com/db/bngiubrjh?a=API_ImportFromCSV&ticket=9_bnhq59q6c_b3nhzn_irxj_a_-b_dgzffhkd5iim4bdnppgpdbs78vct64nqkdf97a28cfbqezkda565cd_jd3u8z")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
@digerata
digerata / dbsync.sh
Created September 24, 2019 12:25
Pull down a database from Heroku. Assumes Rails db names.
#!/bin/bash
APPNAME="$1"
REMOTE="$2"
if [[ "$3" != "" ]]; then
ENVIRONMENT="$3"
else
ENVIRONMENT="development"
fi
@digerata
digerata / app-models-data_import.rb
Last active April 23, 2020 23:54
Importing a large CSV file
class DataImport < ApplicationRecord
belongs_to :company, optional: true # org in this case
belongs_to :user # employee in this case
enum status: %i[pending processing completed failed]
end