This file contains hidden or 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
#!/bin/bash | |
BACKUP_DIR="~/db_backups" | |
DBUSER="" | |
DBPASSWORD="" | |
BUCKET="" | |
FROM='"Backups" <backups@localhost>' | |
TO='"Admin" <admin@localhost>' | |
SUBJECT='Backup Log' |
This file contains hidden or 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
#!/bin/bash | |
USER="" | |
PASSWORD="" | |
if [ -z $1 ]; then | |
echo -e "ERROR: No database name. Usage: export_db DATABASE_NAME" | |
exit; | |
fi | |
DB=$1 |
This file contains hidden or 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
require 'rubygems' | |
require 'aws/s3' | |
# Change the access key and secret to your amazon credentials | |
AWS::S3::Base.establish_connection!( | |
:access_key_id => 'ACCESS_KEY_ID', | |
:secret_access_key => 'SECRET' | |
) | |
# Change this to your S3 bucket name | |
WEBSITE_BUCKET_NAME = "YOUR_BUCKET_NAME" |
This file contains hidden or 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
# Credit to MattLor | |
# http://stackoverflow.com/questions/27267/delete-amazon-s3-buckets | |
require 'aws/s3' | |
AWS::S3::Base.establish_connection!( | |
:access_key_id => 'your access key', | |
:secret_access_key => 'your secret key' | |
) |
This file contains hidden or 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
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] |
This file contains hidden or 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
digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
# Challenge 1: use the <digits> array to display the | |
# numbers 1 - 100 in a 10x10 block. Try to use only | |
# one *puts* statement | |
# terminal output: | |
# | |
# 1 2 3 4 5 6 7 8 9 10 | |
# 11 12 13 14 15 16 17 18 19 20 | |
# 21 22 23 24 25 26 27 28 29 30 |
This file contains hidden or 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
require 'date' | |
require 'colored' | |
require 'time' | |
date = Date.today | |
puts date.strftime("%B %Y").center(20) | |
puts "Su Mo Tu We Th Fr Sa" | |
days_in_month = (Date.new(date.year, 12, 31) << (12 - date.month)).day |
This file contains hidden or 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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains hidden or 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
" Requirements: | |
" - you'll need VIM compiled with Ruby scripting support | |
" - example: for Debian/Ubuntu: sudo apt-get install vim-ruby | |
" - please, copy this file to one of your VIM dir | |
" - example: to your .vim home folder: $HOME/.vim/vimlog.vim | |
" - please, add this code to your .vimrc file: | |
" | |
" if !exists('*Wordpress_vim') | |
" runtime vimlog.vim | |
" endif |
This file contains hidden or 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
tell application "System Events" | |
# create an iTerm session if we dont have one | |
if not (exists (processes where name is "iTerm")) then | |
tell application "iTerm" to (make new terminal) | |
end if | |
tell application "iTerm" | |
activate | |
tell the current terminal | |
set SublimeSessionName to "sublime" |
OlderNewer