This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup Mysql database | |
$ mysqldump -u root -p contracts_production > contracts.sql | |
# Restore Mysql database from sql file | |
$ mysql -u root -p contracts_production < contracts.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
# Edit .bash_profile | |
$ nano ~/.bash_profile | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["ctrl+shift+z"], "command": "insert_snippet", "args": {"contents": "<%= ${0:$TM_SELECTED_TEXT} %>"}, "context": | |
[ | |
{ "key": "selector", "operator": "equal", "operand": "text.html, source.yaml, meta.erb" } | |
] | |
}, | |
{ "keys": ["ctrl+alt+x"], "command": "insert_snippet", "args": {"contents": "<% ${0:$TM_SELECTED_TEXT} %>"}, "context": | |
[ | |
{ "key": "selector", "operator": "equal", "operand": "text.html, source.yaml, meta.erb" } | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo yum -y update | |
$ sudo yum -y install mysql-server mysql-devel | |
$ sudo /etc/init.d/mysqld start | |
$ sudo /usr/bin/mysql_secure_installation | |
# To auto-start on boot: | |
sudo /sbin/chkconfig --level 2345 mysqld on | |
# Check if the above worked by executing the following command: | |
/sbin/chkconfig --list | grep mysqld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person | |
attr_reader :name | |
def initialize(name) | |
@name = name | |
end | |
def introduce | |
"hello, my name is #{@name}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FormatAttributes | |
def formats(*attributes) | |
@format_attributes = attributes | |
end | |
def format_attributes | |
@format_attributes | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV["RAILS_ENV"] = "test" | |
require File.expand_path('../../config/environment', __FILE__) | |
require File.dirname(__FILE__) + '/blueprints' | |
require 'faker' | |
require 'rails/test_help' | |
require 'minitest/autorun' | |
require 'minitest/pride' | |
class MiniTest::Unit::TestCase | |
include MiniTest::ActiveRecordAssertions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Running `mix ecto.migrate` attached to terminal... up, run.6992 | |
** (Postgrex.Error) tcp connect: econnrefused | |
(ecto) lib/ecto/adapters/sql/worker.ex:29: Ecto.Adapters.SQL.Worker.query!/4 | |
(ecto) lib/ecto/adapters/sql.ex:187: Ecto.Adapters.SQL.use_worker/3 | |
(ecto) lib/ecto/adapters/postgres.ex:59: Ecto.Adapters.Postgres.ddl_exists?/3 | |
(ecto) lib/ecto/migration/schema_migration.ex:19: Ecto.Migration.SchemaMigration.ensure_schema_migrations_table!/1 | |
(ecto) lib/ecto/migrator.ex:36: Ecto.Migrator.migrated_versions/1 | |
(ecto) lib/ecto/migrator.ex:134: Ecto.Migrator.run/4 | |
(mix) lib/mix/cli.ex:55: Mix.CLI.run_task/2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.youtube.com/watch?v=fzJcrH6dGGs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
func_check_for_root() { | |
if [ ! $( id -u ) -eq 0 ]; then | |
echo "ERROR: $0 Must be run as root, Script terminating" ;exit 7 | |
fi | |
} | |
func_check_for_root | |
#SETUP PARAMS |