# In your Gemfile
gem "localhost"
# Then, depending on your desired server
gem "falcon"
gem "puma"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseClient | |
class APINotFound < StandardError; end | |
attr_reader :auth_strategy | |
def initialize(auth_strategy: :headers, headers: {}) | |
@auth_strategy = auth_strategy | |
@headers = headers | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def search | |
@pagy, @bookmarks = if params[:search].present? | |
pagy(@bookmarks.search(params[:search]), params: ->(params) { params.merge!({search: params[:search]}) }) | |
else | |
pagy(@bookmarks) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https:// { | |
log | |
tls internal { | |
on_demand | |
} | |
reverse_proxy :3000 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This should be triggered through a cron job at 6:15 PM on week days. | |
# Example cron: 15 18 * * 1,2,3,4,5 cd ~/code/jury_duty && ~/.rbenv/shims/ruby call.rb >> ~/code/jury_duty/call-log.txt 2>&1 | |
# It uses Twilio to make a call based on TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, and TWILIO_PHONE. | |
# It calls the JURY_PHONE, transcribes it, looks for JURER_NUMBER and texts the result to PERSONAL_PHONE. | |
require "rubygems" | |
require "bundler/setup" | |
Bundler.require(:default) | |
Dotenv.load |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# All these requires are just for running via `irb`, if using `bin/rails console` you probably just need the method. | |
require "active_support/all" # Got an inflector NoMethodError, so I'm just being lazy here. | |
require "action_dispatch" | |
require "action_dispatch/routing/route_set" | |
require "action_dispatch/routing/inspector" | |
require "action_controller" # For the ActionController::Parameters autoload, which any route helper uses. | |
# Console helper play around with the routing DSL and tweak an individual route you're building. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'pry' | |
gem "sqlite3" | |
gem 'activerecord' | |
end |
NewerOlder