Skip to content

Instantly share code, notes, and snippets.


Augusts Bautra Epigene

View GitHub Profile
operatino /
Last active Jul 5, 2021 — forked from nrollr/
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
rwarbelow / running_app_in_production_locally.markdown
Created Nov 11, 2015
How to Run a Rails App in Production Locally
View running_app_in_production_locally.markdown
  1. Add gem 'rails_12factor' to your Gemfile. This will add error logging and the ability for your app to serve static assets.
  2. bundle
  3. Run RAILS_ENV=production rake db:create db:migrate db:seed
  4. Run rake secret and copy the output
  5. From the command line: export SECRET_KEY_BASE=output-of-rake-secret
  6. To precompile your assets, run rake assets:precompile. This will create a folder public/assets that contains all of your assets.
  7. Run RAILS_ENV=production rails s and you should see your app.

Remember to clobber your assets (rake assets:clobber) and re-precompile (rake assets:precompile) if you make changes.

View gist:903a7237b9d36388c867
#!/usr/bin/env ruby
# Usage: paste in a file and call it in console with `ruby filename`
# inicializē datu struktūras
musejie = []
`rm out.csv` ; `touch out.csv`
#ielasa no faila pasaucot shell command
musejie = `cat musejie.csv`.split.uniq # musejie.csv satur ierakstus katru jaunā rindiņā caur kuriem laist ciklu
kyletcarlson / json_response_handling_ruby.rb
Created Dec 11, 2013
Ruby script that uses open-uri to fetch the contents of a JSON endpoint, uses the JSON gem to parse the string into a Ruby array & prints some of the records. This is the foundation for all web API requests, so feel free to use it in the future.
View json_response_handling_ruby.rb
require 'open-uri'
require 'json'
require 'pp'
# Construct the URL we'll be calling
request_uri = 'http://localhost:3000/users.json'
request_query = ''
p1nox /
Last active Jul 21, 2021
PostgreSQL configuration without password on Ubuntu for Rails


You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
garyharan / dot_pryrc
Created Jun 18, 2012
Awesome Print + Pry == Awesome Pry
View dot_pryrc
require "rubygems"
require "awesome_print"
Pry.print = proc { |output, value| output.puts }
nhocki / colors.rb
Created Nov 30, 2011
Colorize the output of your ruby rake tasks
View colors.rb
module Colors
def colorize(text, color_code)
:black => 30,
:red => 31,
:green => 32,
:yellow => 33,
thomd /
Created May 4, 2011 — forked from pol/
set the background color of iTerm based on ssh-host
# (1) copy to: ~/bin/ssh-host-color
# (2) set: alias ssh=~/bin/ssh-host-color
# Inspired from
# Fork from