Skip to content

Instantly share code, notes, and snippets.

@rbclark
rbclark / gist:7645955
Created November 25, 2013 18:20
A Github Themed Christmas
Merging through the pulls
On a recently created branch,
Over the commits we go,
Rebasing all the way;
Bells on Travis-CI ring,
Giving builds the green light,
What fun it is to write and push
A fetching song tonight.
Git Commits, git commits,
@rbclark
rbclark / docker-compose.yml
Created October 4, 2017 20:37
Cypress Docker-compose.yml
version: '2'
services:
cypress:
image: projectcypress/cypress:release-latest
environment:
- MONGO_PORT_27017_TCP_ADDR=mongodb
- MONGO_PORT_27017_TCP_PORT=27017
ports:
- "80:3000"
links:
@rbclark
rbclark / package.json
Created March 15, 2022 17:58
Example of postcss.config.js not working properly when using the tailwind CLI
{
"dependencies": {
"postcss": "^8.4.8",
"tailwindcss": "^3.0.23"
},
"scripts": {
"build:css": "yarn tailwind --postcss -i simple.css -o out.css --minify"
}
}
@rbclark
rbclark / devise_turbo_controller.rb
Created August 9, 2022 19:57
Improvement on the GoRails Turbo Controller which fixes an issue with the destroy method not redirecting properly
class DeviseTurboController < ApplicationController
class Responder < ActionController::Responder
def to_turbo_stream
if @default_response
@default_response.call(options.merge(formats: :html))
else
controller.render(options.merge(formats: :html))
end
rescue ActionView::MissingTemplate => error
if get?
require "readline"
CURRENT_INTEREST_RATE=6.97/100
print "Input home value: "
value = gets.chomp.to_i
print "Input interest rate: "
rate = gets.chomp.to_f/100
@rbclark
rbclark / google-oauth-list-users.rb
Created May 17, 2023 17:50
List all users in a Google Admin Directory
require 'google/apis/admin_directory_v1'
require 'googleauth'
require 'googleauth/stores/file_token_store'
OOB_URI = 'urn:ietf:wg:oauth:2.0:oob'
APPLICATION_NAME = 'Google Admin Directory API Ruby Quickstart'
CLIENT_SECRETS_PATH = 'client_secret.json'
CREDENTIALS_PATH = File.join(Dir.home, '.credentials',
"admin-directory_v1-ruby-quickstart.yaml")