Skip to content

Instantly share code, notes, and snippets.

View anthonycrumley's full-sized avatar

Anthony Crumley anthonycrumley

View GitHub Profile
require('mongo')
def client
@client ||= Mongo::Client.new([ '127.0.0.1:27017' ], :database => 'network-dev')
end
def participants
client[:participants]
end
$(document).on 'ready page:load', ->
$('.select2').on 'select2:select', (e) ->
console.log(e.params.data.email)
@anthonycrumley
anthonycrumley / RunHerokuScript.sh
Created November 16, 2016 17:31
A command for running a script with credentials from Heroku
DATABASE_URL=$(heroku config:get DATABASE_URL -a ednetwork) MONGOHQ_URL=$(heroku config:get MONGOHQ_URL -a ednetwork) irb scripts/migrate_members.rb
@anthonycrumley
anthonycrumley / Script2HerokuDB
Created December 1, 2016 01:41
This runs a local script but connects to the heroku database.
DATABASE_URL=$(heroku config:get DATABASE_URL -a ednetwork) SECRET_KEY_BASE=$(heroku config:get SECRET_KEY_BASE -a ednetwork) LANG=$(heroku config:get LANG -a ednetwork) DISABLE_SPRING=1 RAILS_ENV=production RACK_ENV=production rails runner "puts School.first.inspect"
@anthonycrumley
anthonycrumley / survey_monkey.rb
Created July 20, 2018 12:52
SurveyMonkey and ruby_http_client
require 'ruby_http_client'
class Http < SendGrid::Client
end
bearer_token = 'my token'
survey_monkey = Http.new(host: 'https://api.surveymonkey.com/v3', request_headers: {'Authorization' => "Bearer #{bearer_token}", "Content-Type" => "application/json"})
survey_monkey.users.me.get.parsed_body
@anthonycrumley
anthonycrumley / settings.json
Created August 18, 2023 23:57
VS Code Settings
{
"python.condaPath": "C:\\Users\\antho\\anaconda3\\Scripts\\conda-script.py",
"python.defaultInterpreterPath": "C:\\Users\\antho\\anaconda3\\python.exe",
"python.pythonPath": "C:\\Users\\antho\\anaconda3\\python.exe",
"python.terminal.activateEnvironment": true,
"terminal.integrated.defaultLocation": "editor",
"python.linting.flake8Enabled": true,
"vim.normalModeKeyBindings": [
// Open the settings JSON file.
{