Skip to content

Instantly share code, notes, and snippets.

View MatthewRDodds's full-sized avatar

Matthew Russell Dodds MatthewRDodds

View GitHub Profile
@jeromedalbert
jeromedalbert / .gitattributes
Last active March 3, 2024 12:18
Automatically resolve Git merge conflicts in Rails schema.rb by picking the most recent date in the conflict (now works with Rails 5 and recent versions of Git). The following files should be in your home ~ directory. Inspired by https://tbaggery.com/2010/10/24/reduce-your-rails-schema-conflicts.html
db/schema.rb merge=railsschema
@jessejanderson
jessejanderson / intro-to-otp-in-elixir-resources.md
Last active June 15, 2023 05:03
Intro to OTP in Elixir - Resources
@robertoestivill
robertoestivill / launcher.sh
Last active November 7, 2019 18:45
Bash alternative to Franz
#!/bin/bash
open -a "Google Chrome" --new --args --new-window \
'https://tweetdeck.twitter.com' \
'https://web.whatsapp.com' \
'https://blastersystems.slack.com/' \
'https://www.messenger.com/' \
'https://web.telegram.org/' \
'https://web.skype.com' \
'https://hangouts.google.com/' \
@MatthewRDodds
MatthewRDodds / gist:59d444d491eab384fb5c
Created February 23, 2016 17:17
Skipping Authentication For Rspec Controllers in a Json API
RSpec.configure do |config|
  config.before(:each, type: :controller) do |example|
    unless example.metadata[:skip_login_mock]
      allow_any_instance_of(ApiController).to receive(:restrict_access)
        .and_return(true)
    end
  end
end
@shiroyasha
shiroyasha / dog.rb
Created February 16, 2016 22:20
Method tracer for Ruby classes
class Dog
attr_writer :name
def initialize(name)
@name = name
end
def bark
puts "patrick"
end
@DecisionNerd
DecisionNerd / csv2json.sh
Created November 13, 2015 03:13
CSV to JSON converter using BASH. Original script from http://blog.secaserver.com/2013/12/convert-csv-json-bash/
#!/bin/bash
# CSV to JSON converter using BASH
# original script from http://blog.secaserver.com/2013/12/convert-csv-json-bash/
# thanks SecaGuy!
# Usage ./csv2json.sh input.csv > output.json
input=$1
[ -z $1 ] && echo "No CSV input file specified" && exit 1
[ ! -e $input ] && echo "Unable to locate $1" && exit 1
@hpjaj
hpjaj / Segfault
Created September 22, 2015 20:36
Segfault
This file has been truncated, but you can view the full file.
➜ pws git:(feature/talkbox/94-sign-in-telephone-icon) ✗ foreman start
14:24:20 web.1 | started with pid 8641
14:24:20 resque_worker.1 | started with pid 8642
14:24:20 scheduler.1 | started with pid 8643
14:24:20 web.1 | Phusion Passenger Standalone is already running on PID 8437.
14:24:20 web.1 | exited with code 1
14:24:20 system | sending SIGTERM to all processes
14:24:20 resque_worker.1 | terminated by SIGTERM
14:24:20 scheduler.1 | terminated by SIGTERM
➜ pws git:(feature/talkbox/94-sign-in-telephone-icon) ✗ kill 8437
@MatthewRDodds
MatthewRDodds / gist:3ad29d0dd67a77d66810
Created June 2, 2015 15:13
Travis Changelog Update Check
#!/usr/bin/env bash
# This script is run as part of the travis CI process to ensure that the
# changelog in every app has been updated when working on a feature branch.
# If there is no update to the changelog file (CHANGELOG.md), it exits with
# an error causing the travis build to fail.
# Only run this when ci script is executed by travis
${CI?"Not excuted by travis"}
@chantastic
chantastic / on-jsx.markdown
Last active March 20, 2024 01:03
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@alkuzad
alkuzad / check_rubocop
Created April 28, 2015 09:17
Rubocop check only files that are changed
# Needs showlinennum in ~/bin folder of user, change it to some more general
# solution if you have showlinenum in path
if [ "$1" == "" ];then
rev="HEAD"
else
rev="$1"
fi
if [ -e ~/bin/showlinenum.awk ]; then