Skip to content

Instantly share code, notes, and snippets.

@shedd
shedd / CI Deploy Pattern for Netlify.md
Last active October 30, 2018 16:59
A simple pattern for pushing production builds live on Netlify when your CI build passes.
@afn
afn / gist:c04ccfe71d648763b306
Created June 12, 2014 15:35
Restart phantomjs when it hangs
# Borrowed from https://github.com/y310/rspec-retry/blob/master/lib/rspec/retry.rb
CAPYBARA_TIMEOUT_RETRIES = 3
RSpec.configure do |config|
config.around(:each, type: :feature) do |ex|
example = RSpec.current_example
CAPYBARA_TIMEOUT_RETRIES.times do |i|
example.instance_variable_set('@exception', nil)
self.instance_variable_set('@__memoized', nil) # clear let variables
@dseese01
dseese01 / Fidelity2Factor.md
Created April 19, 2014 23:00
Fidelity Two-Factor Authentication

Fidelity Investments Two-Factor Authentication for Account Access

[Fidelity] (https://www.fidelity.com/) offers two-factor authentication, which provides a second layer of protection beyond a password for accessing an account on their website. It uses either a physical token provided by Fidelity or the Symantec VIP Access smartphone app. It appears there is no information about this service provided online and it must be enabled and managed by phone.

Note that this is different than the weaker [“Transaction Security”] (https://fps.fidelity.com/ftgw/Fps/Fidelity/SecurityDevice/Maintain/Init), which only protects certain types of transactions.

Instructions for Setting Up Fidelity Two-Factor Authentication

  1. Do one of the following:
  • Obtain a physical token by calling Fidelity Account Key Support at 800-544-7595.
@Kapeli
Kapeli / cdn.js
Created February 25, 2014 22:17
function latencyTest(url) {
$.ajax({
url: "http://"+url+".kapeli.com/feeds/latencyTest_v2.txt",
cache: false,
success: function(content){
if(beginsWith("Just a latency test. Move along.", content))
{
var link = document.getElementsByClassName("downloadButton")[0];
if(link.getAttribute("href") == "Dash.zip")
{
@chrismccoy
chrismccoy / gitcheats.txt
Last active July 16, 2024 11:44
git cheats
# alias to edit commit messages without using rebase interactive
# example: git reword commithash message
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f"
# count total commits in a repo
git rev-list --all --count
# edit all commit messages
git rebase -i --root
@joestump
joestump / San_Francisco.mkd
Created February 1, 2014 02:05
Here are two tours of San Francisco and the surrounding area. Both take about a day. One is entirely within the city and can be done entirely via public transportation. The other requires a car and gets you outside of SF to some of the wonderful sites that comprise the Yay Area.

San Francisco by Foot

  • You can start anywhere in the Castro, Mission (home of the burrito), or downtown. I'd recommend starting at Chow at Market & Church or The Pork Store on 16th at Valencia. If you wanted to go upscale on the weekend, Maverick at 17th and Mission is a fantastic brunch. Another option is to start in Chinatown (just north of Union Squre) for dim sum.
  • From Castro take one of the N, J, etc. trains (every light rail train route in the city intersects at Church and Market) down to the Powell Street station. From the Mission you can take BART a couple of stops up to Powell Street.
  • Once at Powell Street hop on the Powell Street trolley. A quintessential SF experience.
  • Take the trolley up through the city where it will eventually stop at Lombard Street, which is known as the most crooked street in the world. Walk down the hill, take a few pictures and laugh at the tourists trying to drive down the damn thing.
  • Once at the bottom of the hill, turn left. You'll be walking towards the w
@thansmann
thansmann / BOSH_Prep_URLs
Last active August 29, 2015 13:55
Preparing For BOSH URL
Slide deck: https://docs.google.com/presentation/d/12a48nOaJe4WkmYgQJOJCO8LanIEES3ZC6QstAxpKHlU/edit?usp=sharing
Bosh-Lite: https://github.com/cloudfoundry/bosh-lite
DrNic's Fast setup of BOSH Redis release with bosh-gen using bosh-lite: http://starkandwayne.com/articles/2013/12/02/rapid-dev-with-bosh-lite/
DrNic on Jobs and Packages: https://github.com/cloudfoundry-community/bosh-gen/blob/master/README.md
BOSH Dummy Release: https://github.com/abic/dummy-boshrelease
Slightly dated, but still a good intro: http://www.think-foundry.com/
BOSH info page: http://bosh.cfapps.io/
BOSH repo: https://github.com/cloudfoundry/bosh
Cloud Foundry repo: https://github.com/cloudfoundry/cf-release
@aaronfeng
aaronfeng / bundle_ruby
Last active December 31, 2015 19:09
Intercepts `ruby` in order to prepend `bundle exec` if Gemfile.lock is present
#!/bin/bash
# remember original ruby location
export CURRENT_RUBY=$(which ruby)
alias ruby="ruby_wrapper"
# call bundle exec if there's a Gemfile.lock
function ruby_wrapper() {
# unalias it to get the real ruby version
@skwp
skwp / dynamic_method_spec.rb
Created December 7, 2013 00:44
Fail your build for user-defined style rules.
require 'spec/support/grep_matcher'
describe do
disallow_presence_of pattern: "send(.*#",
location: "app/",
description: "Do not use dynamic method invocations",
failure: "Please change dynamic method call to something more sane."
end
@jmondo
jmondo / simple_delegator_example.rb
Last active December 26, 2015 16:09
simple delegator example from sfrails oct 2013
# it's all part of ruby!
require 'ostruct'
require 'delegate'
require 'forwardable'
require 'minitest/autorun' # can run rspec style tests with this, part of ruby
# ---------------------------------------------------------------------------------------------------------
# the classes
# using simple delegator with the country object /after/ this app has been made with bad dependency mgmt.
# we swap the country string 'FIN' out for a country object with Country.new('FIN')