Skip to content

Instantly share code, notes, and snippets.

View livando's full-sized avatar

Don Livanec livando

View GitHub Profile
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active June 7, 2024 20:53
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 :

@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'
# }
@mutewinter
mutewinter / gifify.sh
Last active December 25, 2015 12:29 — 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
@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 / Alfred 3 Workflows.md
Last active November 25, 2020 14:14
A list of Alfred 3 workflows I'm using.
@livando
livando / devise_msgs.rb
Created November 16, 2012 14:40
Pull Devise messages from YAML
msgs = YAML::load(File.open("#{::Rails.root.to_s}/config/locales/devise.en.yml"))
 
msgs['en']['devise']['failure']['unauthenticated']
@seratch
seratch / config.yml
Created October 25, 2012 09:37
AWS SQS Example
access_key_id: xxx
secret_access_key: yyy
@peter
peter / creating-edgerails-app.sh
Created June 30, 2012 21:03
Creating and Deploying an EdgeRails (Rails 4) Application to Heroku
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it
gem install bundler
# 1. Get edge Rails source (master branch)
git clone https://github.com/rails/rails.git
@evanbeard
evanbeard / registrations_controller.rb
Created May 11, 2012 19:53 — forked from jwo/registrations_controller.rb
API JSON authentication with Devise
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else
@ahoward
ahoward / a.rb
Created May 8, 2012 16:06
did i mention style is everything?
#
# perl got some things right. here-docs were one of them. YAML takes this
# further when we have to define large data structures.
#
# if you find yourself typing " ' ) ( [ ] too many times in a row, whack
# yourself on the wee-wee with a keyboard and whip out the YAML
#
this_fucking_licks_hairy_balls_to_edit =