This file contains hidden or 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
| namespace :routes do | |
| desc "Writes doc/routes.html. Requires Graphviz (dot)" | |
| task :visualizer => :environment do | |
| File.open(Rails.root.join('doc', 'routes.html'), 'wb') do |f| | |
| f.write Rails.application.routes.router.visualizer | |
| end | |
| end | |
| end |
This file contains hidden or 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
| # Copy and paste this to the rails console to test your email settings | |
| class MyMailer < ActionMailer::Base | |
| def test_email | |
| @recipients = "[email protected]" | |
| @from = "[email protected]" | |
| @subject = "Test from the Rails Console" | |
| @body = "This is a test email" | |
| end | |
| end |
This file contains hidden or 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
| module FactoryGirl | |
| module Doctor | |
| module FloatDuration | |
| refine Float do | |
| def duration | |
| t = self | |
| format("%02d:%02d.%03d", t / 60, t % 60, t.modulo(1) * 1000) | |
| end | |
| end | |
| end |
This file contains hidden or 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 Gist is some crib notes/tests/practice/whatever for talking to Active Directory via LDAP. The (surprisingly | |
| # helpful) documentation for Net::LDAP can be found here: http://net-ldap.rubyforge.org/Net/LDAP.html | |
| ####################################################################################################################### | |
| require 'rubygems' | |
| require 'net/ldap' | |
| ####################################################################################################################### | |
| # HELPER/UTILITY METHOD |
This file contains hidden or 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
| { | |
| "ipcMode": null, | |
| "executionRoleArn": "arn:aws:iam::<aws-account-number>:role/ecsTaskExecutionRole", | |
| "containerDefinitions": [ | |
| { | |
| "dnsSearchDomains": [], | |
| "logConfiguration": { | |
| "logDriver": "awslogs", | |
| "secretOptions": [], | |
| "options": { |
This file contains hidden or 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
| ruby '2.7.1' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
| # Action Text | |
| gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
| gem 'okra', github: 'basecamp/okra' | |
| # Drivers |
This file contains hidden or 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
| import React from 'react'; | |
| import { | |
| actions, | |
| makePropGetter, | |
| ensurePluginOrder, | |
| functionalUpdate, | |
| useConsumeHookGetter, | |
| useGetLatest | |
| } from '../../react-table/utils'; |
This file contains hidden or 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
| # Rails production setup via SQLite3 made durable by https://litestream.io/ | |
| # Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine. | |
| # | |
| # try locally: docker build . -t rails && docker run -p3000:3000 -it rails | |
| # | |
| # in production you might want to map /data to somewhere on the host, | |
| # but you don't have to! | |
| # | |
| FROM ruby:3.0.2 |
This file contains hidden or 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 ApplicationController < ActionController:Base | |
| extend ControllerMacros | |
| end |
This file contains hidden or 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 OfficeAPIError < StandardError; end; | |
| class OfficeAPITimoutError < StandardError | |
| def initialize(msg = "Office API timed out") | |
| super(msg) | |
| end | |
| end | |
| class OfficeAPI | |
| attr_accessor :access_token, :messages_filter, :mail_box, :fetch_from |