Skip to content

Instantly share code, notes, and snippets.

View andrewmcodes's full-sized avatar
🌱

Andrew Mason andrewmcodes

🌱
View GitHub Profile
@mustafaturan
mustafaturan / rename.sh
Created August 24, 2017 09:33
Copy all .example files in a folder with removal of .example extension.
for f in *.example; do
cp -- "$f" "${f%.example}"
done
@saboyutaka
saboyutaka / Dockerfile
Created July 28, 2018 06:20
Docker Compose for Rails
FROM ruby:2.5.1
ENV LANG C.UTF-8
RUN apt-get update -qq && \
apt-get install -y --no-install-recommends \
build-essential \
libpq-dev \
libfontconfig1 \
less \
@davidwessman
davidwessman / .circleci-config.yml
Created August 13, 2017 14:54
CircleCI 2.0 setup
version: 2
jobs:
build:
working_directory: ~/mowers
docker:
- image: circleci/ruby:2.4.1-node
environment:
PGHOST: 127.0.0.1
PGUSER: mower
RAILS_ENV: test
@kurko
kurko / spec_helper.rb
Created February 29, 2012 21:37
Sunspot with RSpec
#inside RSpec.configure
config.before :all do
SunspotTest.stub
end
config.before(:all, search: true) do
SunspotTest.setup_solr
Sunspot.remove_all!
Sunspot.commit
require 'sunspot_ext/resque_session_proxy'
require 'sunspot_ext/resque_index_job'
Sunspot.session = Sunspot::ResqueSessionProxy.new(Sunspot.session)
@ramonrails
ramonrails / puma-dev.sh
Last active September 10, 2020 18:14
puma-dev management script
#!/bin/bash
# author: ramonrails.in
# version: 1.0
# release date: 7-Aug-2017
# license: MIT
# style for output
bold=$(tput bold)
cyan=$(tput setaf 6)
@MikeRogers0
MikeRogers0 / setup_puma_dev.local
Created September 23, 2017 13:58
Setup Puma Dev
brew install puma/puma/puma-dev &&
sudo puma-dev -setup &&
puma-dev -install &&
security add-trusted-cert -k login.keychain-db ~/Library/Application\ Support/io.puma.dev/cert.pem
@paulomcnally
paulomcnally / compression.rb
Created August 10, 2017 08:10 — forked from SunDi3yansyah/compression.rb
Ruby on Rails: Minify HTML, CSS, & JS, and compress with gzip https://remino.net/rails-html-css-js-gzip-compression/
# config/initializers/compression.rb
Rails.application.configure do
# Use environment names or environment variables:
# break unless Rails.env.production?
break unless ENV['ENABLE_COMPRESSION'] == '1'
# Strip all comments from JavaScript files, even copyright notices.
# By doing so, you are legally required to acknowledge
# the use of the software somewhere in your Web site or app:
@infews
infews / be.rb
Last active July 5, 2021 22:51
a "better" be "alias" for bundle exec, prioritizing local binstubs
#!/usr/bin/env ruby
# Smarter be for ruby projects that prioritizes local project binstubs
# - uses zsh when needed, assuming MacOS Catalina or later
# - save on your path
# - drop the .rb
# - chmod +x
# - always type `be <command>` and the right thing should happen
#
# - inspired by Justin Searls (@searls)
@whoisryosuke
whoisryosuke / adding-prettier-to-projects.md
Last active August 30, 2021 10:27
Workflow - Adding ESLint (Airbnb) + Prettier to projects
# Install ESLint and Babel ESLint
# Make sure to install at least v5.1.0 of ESLint
npm install --save-dev eslint babel-eslint

# Install the Airbnb configs (3 of them, listed below)
npx install-peerdeps --dev eslint-config-airbnb

# Install Prettier + ESLint config
npm install --save-dev --save-exact prettier eslint-config-prettier