Skip to content

Instantly share code, notes, and snippets.

View joshuaadrian's full-sized avatar

Joshua Adrian joshuaadrian

View GitHub Profile
@joshuaadrian
joshuaadrian / Bash Profile
Created September 5, 2013 13:47
Colored Bash profile with git/hg branch names. Place in your .bash_profile file.
export TERM=xterm-256color
DEFAULT=$"\e[38;5;247m"
PINK=$"\e[38;5;163m"
GREEN=$"\e[38;5;76m"
ORANGE=$"\e[38;5;208m"
RED=$"\e[38;5;160m"
BLUE=$"\e[38;5;26m"
parse_git_branch() {
RewriteBase /
RewriteCond %{HTTP_HOST} !oldexample.com$ [NC]
RewriteRule ^(.*)$ http://newexample.com/$1 [L,R=301]
mysqldump -u username -h localhost --skip-triggers --compact --no-create-info database_name > database_dump_name.sql -p
mysqldump -u username -h localhost --no-data -p database_name > database_dump_name.sql
RewriteRule ^this/that\.html$ http://www.something.com/that/ [R=301,L]
<?php
/**
*
* Safe Search and Replace on Database with Serialized Data v2.1.1
*
* This script is to solve the problem of doing database search and replace when
* developers have only gone and used the non-relational concept of serializing
* PHP arrays into single database columns. It will search for all matching
* data on the database and change it, even if it's within a serialized PHP
* array.
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
BrowserMatch MSIE ie
Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
</IfModule>
</IfModule>
<FilesMatch "\.(ttf|otf|eot|woff|font.css)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
//Which version of Ruby
ruby -v
//install bundles
bundle install
//install bundler
gem install bundler
//Database commands
# Make a new cron job
crontab -e
# List your cron jobs
crontab -l
# Example cron command using artisan
0/5 * * * * /usr/bin/php /Users/joshua/Dropbox/htdocs/laravel/artisan cron:run
php artisan key:generate
php artisan session:table
php artisan migrate:install
php artisan migrate
php artisan migrate application
php artisan migrate bundle
php artisan migrate:rollback
php artisan migrate:reset