Skip to content

Instantly share code, notes, and snippets.

View lcguida's full-sized avatar
🏠

Leandro Guida lcguida

🏠
View GitHub Profile
@lcguida
lcguida / pre-push
Last active August 4, 2017 14:21 — forked from calebhaye/pre-push
Run tests before git push (within specified branches)
#!/bin/bash
branches_to_test=('master' 'staging' 'develop')
branch=`git rev-parse --abbrev-ref HEAD`
test_branch () {
local e
for e in "${branches_to_test[@]}"
do
@lcguida
lcguida / active_admin.scss
Last active June 27, 2017 08:29 — forked from seanlinsley/active_admin.scss
Make Active Admin's primary color change between dev/staging/production
// SASS variable overrides must be declared before loading up Active Admin's styles.
//
// To view the variables that Active Admin provides, take a look at
// `app/assets/stylesheets/active_admin/mixins/_variables.css.scss` in the
// Active Admin source.
//
// For example, to change the sidebar width:
// $sidebar-width: 242px;
$primary-color: dynamic_active_admin_color();
require 'rubygems'
require 'dm-core'
require 'dm-migrations'
require 'dm-timestamps'
DataMapper::Logger.new($stdout, :debug)
DataMapper.setup(:default, "mysql://root@localhost/db_development")
class Tester
include DataMapper::Resource
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
This script set ownership for all table, sequence and views for a given database
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto