Skip to content

Instantly share code, notes, and snippets.

View samandmoore's full-sized avatar

Sam Moore samandmoore

View GitHub Profile
@tokenvolt
tokenvolt / simple_form_bootstrap3.rb
Last active November 2, 2023 11:55
Bootstrap 3 simple form initializer
inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
RangeInput
StringInput
TextInput

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@hmnhf
hmnhf / mandrillapp_invalid_sender_characters.rb
Last active November 13, 2020 09:20
Mandrillapp invalid sender characters
# I was encountering this exception: Net::SMTPServerBusy: 401 4.1.7 Bad sender address syntax
# First I searched to see if there's any documentation around this issue but didn't find anything,
# so I wrote this snippet to find those invalid characters.
require 'mail'
Mail.defaults do
delivery_method :smtp, {
port: 25,
address: "smtp.mandrillapp.com",
@minillinim
minillinim / howto.md
Created May 10, 2017 05:43
Buildkite + monorepo + hooks

If you use a monorepo you can place a .buildkite/pipeline.yml in each of the sub repos/folders and set buildkite to look there using a pipeline command as your first step. Such as:

[[ -f "<SUB_FOLDER>/.buildkite/pipeline.yml" ]] && buildkite-agent pipeline upload <SUB_FOLDER>/.buildkite/pipeline.yml || true

Where <SUB_FOLDER> is the name of your sub repo / folder.

Unfortunately, if you try to use pre- and post-command hooks this way buildkite won't pick them up, it

@lvangool
lvangool / sidekiq_safe_shutdown.rb
Last active July 30, 2024 13:21
Kubernetes: Graceful Sidekiq Shutdown
#! /usr/bin/env ruby
# encoding: utf-8
## PURPOSE: this script will quiet any sidekiq workers it finds,
## and then shut them down when they are no longer handling jobs
# utility class for logging and running commands
class Utils
require 'open3'
attr_accessor :output
@smudge
smudge / switch_remote_from_upstream_to_fork.sh
Last active March 30, 2022 14:18
Switch a git repo to track a fork origin, with read-only upstream.
#### Switch a git repo to track a fork origin, with read-only upstream.
# Step 1: Press that "fork" button on github to fork a repo to your account.
# (Don't worry -- if it's a private repo, your fork will still be private
# and should be effectively owned by the original repo's organization.)
# Step 2: Update your local repo
# IMPORTANT: This assumes your local repo is a clone of the ORIGINAL/upstream repo.
## Add a new 'upstream' remote and add a bogus URL for push commands.
@zepptron
zepptron / gist:9635568b9d90d858daca7780feb8c4b7
Created June 19, 2018 08:34
.bashrc & .zshrc: usefull kubectl + fzf
podlog () {
local pod=($(kubectl get pods --all-namespaces -o wide | fzf | awk '{print $1, $2}'))
echo kubectl logs -n ${pod[1]} ${pod[2]}
kubectl logs -n ${pod[1]} ${pod[2]}
}
podexec () {
local pod=($(kubectl get pods --all-namespaces -o wide | fzf | awk '{print $1, $2}'))
local cmd=${@:-"/bin/sh"}