Community
Cheatsheets
- GenServer Cheatsheet by Benjamin Tan Wei Hao
Books
db/schema.rb merge=railsschema |
Community
Cheatsheets
Books
#!/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/' \ |
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
class Dog | |
attr_writer :name | |
def initialize(name) | |
@name = name | |
end | |
def bark | |
puts "patrick" | |
end |
#!/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 |
➜ 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 |
#!/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"} |
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
# 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 |