Skip to content

Instantly share code, notes, and snippets.

View forkata's full-sized avatar

Chris Todorov forkata

View GitHub Profile
@jhawthorn
jhawthorn / bundle.sh
Last active December 24, 2015 16:59
using vendor/bundle with spree
for dir in api backend core frontend sample .; do
mkdir -p "$dir/.bundle"
cat > "$dir/.bundle/config" << EOF
BUNDLE_DISABLE_SHARED_GEMS: '1'
BUNDLE_PATH: '`pwd`/vendor/bundle'
EOF
done
@cbrunsdon
cbrunsdon / gist:7272584
Created November 1, 2013 21:56
frt weechat grove settings
/server add frt freerunningtech.irc.grove.io/6697 -ssl
/set irc.server.frt.password freerunningtech
/set irc.server.frt.ssl_verify no
/set irc.server.frt.username "clarke"
/set irc.server.frt.command "/msg NickServ identify ******":

We need an improvement to our architecture to allow us to test portions of spree more easily. However I believe we will always need working complete factories form, at least for integration tests.

Regardless of what we're to do in the future. I thought it may be useful to document why all these queries are currently run, and what options we have to reduce their number.

[1] pry(#)&gt; create(:line_item)
@gvaughn
gvaughn / description.md
Last active September 28, 2015 23:44
Address changes

What's up with Address and UserAddressBook?

It's a domain level refactoring. Address is now readonly with copy on write semantics, so once it's in the db, it doesn't change. If you use the typical nested attributes for addresses in Orders (and now Users and CreditCards) it'll just work. If you need to create them manually Address.factory and Address.immutable_merge are your new friends. UserAddressBook is foundational work to ultimately allow users a richer set of addresses to use for pre-fill during checkout.

Background

I was asked to add what seemed like a fairly simple new feature to our custom frontend code, but upon digging I found that it would require some fairly large refactoring to do it well. That new feature was to allow the user to manage a list of addresses in their account section of our frontend. Those will be used as options to pre-fill during checkout. The things that I found that I wanted to refactor were some missing and misplaced address associations, plus a lot of unn

@alexblackie
alexblackie / pivotal_deliverance.rb
Created November 3, 2015 20:46
Meant to be run in a Jenkins job; marks stories in Pivotal as "Delivered" if their IDs are mentioned in a commit that's part of the current Jenkins build changeset.
require "net/http"
require "json"
require "pry"
# Wrapper around the Jenkins JSON API
class Jenkins
# @param [string] jenkins_user - a Jenkins user with at least read access
# @param [string] token - Jenkins API token for the user
# @param [string] job - Jenkins job name
def initialize(jenkins_user, token, job)
@danieleggert
danieleggert / GPG and git on macOS.md
Last active March 6, 2025 20:45
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 15, 2025 22:49
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

require 'aws-sdk'
require 'timeout'
def wait_for_completion(opsworks, result)
status = 'running'
Timeout::timeout(300) do
while (status == 'running') do
sleep(5)
response = opsworks.describe_deployments(
deployment_ids: [result.deployment_id]
@troyfontaine
troyfontaine / 1-setup.md
Last active May 15, 2025 22:58
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

[merge]
tool = mymeld
conflictstyle = diff3
[mergetool "mymeld"]
# Shows three-pane merge view with central output directly being the merged file to save
cmd = $MANISHMELD $LOCAL $BASE $REMOTE --output=$MERGED
#cmd = meld "$LOCAL" "$BASE" "$REMOTE"