Skip to content

Instantly share code, notes, and snippets.

View randallreedjr's full-sized avatar

Randall Reed, Jr. randallreedjr

View GitHub Profile

To copy a Heroku ENV variable from one application to another, from a bash shell, run

heroku config:set MY_VAR="$(heroku config:get MY_VAR --app old-app-name)" --app new-app-name
@toadkicker
toadkicker / circle.yml
Last active August 29, 2018 15:17
CircleCI 2.0 configuration for Ruby on Rails 5.1+ with headless chromedriver
# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/ruby:2.5.1-node-browsers

Prerequisites

Verify latest Ruby version

Ruby downloads

Check local Ruby version (CLI)

$ ruby -v

If necessary, upgrade Ruby (CLI)

$ rvm get stable
@orafaelfragoso
orafaelfragoso / home_controller_spec.rb
Created August 8, 2014 19:06
Testing a root route with Rspec
require 'rails_helper'
RSpec.describe HomeController, :type => :controller do
describe "GET index" do
it "renders the :index template" do
expect(get: root_url(subdomain: nil)).to route_to(
controller: "home",
action: "index")
@magicznyleszek
magicznyleszek / jekyll-and-liquid.md
Last active January 12, 2024 03:46
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@branneman
branneman / better-nodejs-require-paths.md
Last active April 8, 2024 00:22
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@michaelkoper
michaelkoper / gist:5007636
Last active January 25, 2018 18:25
Handling with money in Mongoid
class Product
include Mongoid::Document
field :price, type: Money
end
Money.class_eval do
# Converts an object of this instance into a database friendly value.
def mongoize
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2: