Function | Shortcut |
---|---|
Previous Tab | ⌘ + Left Arrow |
Next Tab | ⌘ + Right Arrow |
Go to Tab | ⌘ + Number |
Go to Window | ⌘ + Option + Number |
Go to Split Pane by Direction | ⌘ + Option + Arrow |
Go to Split Pane by Order of Use | ⌘ + ] , ⌘ + [ |
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
#!/bin/bash | |
# this script makes a database backup and delete files older than 15 days | |
# to make script execuable use 'chmod +x backupdb.sh' | |
# change username, password and database for yours and modify your path if needed | |
mysqldump -u [username] -p[password] [database_name] > /root/backups/db_backup_`date +"%Y%m%d%H%M%S"`.sql | |
# change '-mtime +15' to keep more or less days (and path if needed) | |
find /root/backups/* -mtime +15 -exec rm {} \; |
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
<script> | |
window.addEventListener('devicelight', function(e) { | |
var lux = e.value; | |
if (lux < 50) { // luz tenue | |
document.body.className = 'tenue'; | |
} | |
if (lux >= 50 && lux <= 1500) { //luz normal | |
document.body.className = 'normal'; | |
} |
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
// ## Globals | |
var argv = require('minimist')(process.argv.slice(2)); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var browserSync = require('browser-sync').create(); | |
var changed = require('gulp-changed'); | |
var concat = require('gulp-concat'); | |
var flatten = require('gulp-flatten'); | |
var gulp = require('gulp'); | |
var gulpif = require('gulp-if'); | |
var imagemin = require('gulp-imagemin'); |
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
# Git branch in prompt. | |
# from http://mfitzp.io/article/add-git-branch-name-to-terminal-prompt-mac/ | |
# add to ~/.bash_profile | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ " |
Make an alias to sublime bin subl
.
Edit file
~/.bash_profile
add
alias sublime="'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'"
restart bash if needed
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
<?php | |
//edit with your data | |
$repo_dir = '~/repository.git'; | |
$web_root_dir = '~/project'; | |
$post_script = '~/project/scripts/post_deploy.sh'; | |
$onbranch = 'master'; | |
// A simple php script for deploy using bitbucket webhook | |
// Remember to use the correct user:group permisions and ssh keys for apache user!! | |
// Dirs used here must exists on server and have owner permisions to www-data |
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
$ for f in *\ *; do mv "$f" "${f// /_}"; done |
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
#!/bin/bash | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
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
Options +FollowSymLinks | |
<ifModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !index | |
RewriteRule (.*) index.html [L] | |
</ifModule> |