Skip to content

Instantly share code, notes, and snippets.

View migzsuelto's full-sized avatar

migz migzsuelto

View GitHub Profile
@migzsuelto
migzsuelto / db.rake
Created June 5, 2020 00:36 — forked from khalilgharbaoui/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
# Original source: https://gist.github.com/hopsoft/56ba6f55fe48ad7f8b90
# Merged with: https://gist.github.com/kofronpi/37130f5ed670465b1fe2d170f754f8c6
# Benefits of: https://gist.github.com/e12e/e0c7d2cc1d30d18c8050b309a43450ac
# And fixes of: https://gist.github.com/joelvh/f50b8462611573cf9015e17d491a8a92
namespace :db do
desc 'Dumps the database to backups'
task dump: :environment do
dump_fmt = ensure_format(ENV['format'])
dump_sfx = suffix_for_format(dump_fmt)
backup_dir = backup_directory(Rails.env, create: true)
@migzsuelto
migzsuelto / nginx.conf
Created September 22, 2016 09:15 — forked from calebwoods/nginx.conf
Sample Nginx config for deployment of Angular.js app
server { listen 80;
server_name example.com;
access_log /var/log/example.com/nginx.access.log;
error_log /var/log/example.com/nginx.error.log;
root /var/www/apps/example.com/public;
charset utf-8;
location / {
rewrite ^ https://$host$request_uri? permanent;
}
// Generated on 2014-06-25 using generator-angular 0.9.1
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
var modRewrite = require('connect-modrewrite');
<html>
<head>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" type="text/css">
<style type="text/css">
code { display: block; }
pre { color: green; }
</style>
</head>
<body>
<h1>Balanced Sample - Collect Bank Account Information</h1>
@migzsuelto
migzsuelto / fix_homebrew.rb
Created October 14, 2012 18:40 — forked from rpavlik/fix_homebrew.rb
Fix permissions on /usr/local for Homebrew
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
@migzsuelto
migzsuelto / postgres_rails_os_x
Created October 3, 2012 10:03 — forked from johnnyjung/postgres_rails_os_x
PostgreSQL with Rails on OS X
# Setting up and using PostgreSQL with Rails on OS X
# Allows you to use PostgreSQL instead of sqlite3, and have the same database type as Heroku
# Install postgres using homebrew
brew install postgres
# Follow directions provided by postgres installation
# Instructions for this part can be retrieved again using "brew info postgres"
# This creates a default user according to your system name
# If you encounter an error similar to this, then check out these helpful links