Skip to content

Instantly share code, notes, and snippets.

View livando's full-sized avatar

Don Livanec livando

View GitHub Profile
@yock
yock / factories.rb
Created May 2, 2013 14:32
Nested factories in FactoryGirl
FactoryGirl.define do
factory :user do
name "#{Faker::Name.first_name} #{Faker::Name.last_name}"
email Faker::Internet.email
username Faker::Internet.user_name
password 'password'
stripe_customer_id 'cus_1'
factory :deactivated_user do
deactivated true
@mutewinter
mutewinter / gifify.sh
Last active January 11, 2025 22:22 — forked from SlexAxton/.zshrc
# Sweet Gif Creation from .mov
#
# Adapted from https://gist.github.com/SlexAxton/4989674
gifify() {
if [[ -n "$1" ]]; then
GIF="${1%.*}.gif"
if [[ $2 == '--bad' ]]; then
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $GIF
else
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
@ngauthier
ngauthier / reportable.rb
Last active December 28, 2015 22:09
Reportable Concern
module Reportable
extend ActiveSupport::Concern
module ClassMethods
# Chain on a scope and specify the fields to extract.
# Example:
# User.enabled.report %{
# :email_opt_in,
# 'created_at as sign_up_date'
# }
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active March 7, 2025 05:00
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :