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
tell application "Google Chrome" | |
set windowList to every tab of every window whose URL starts with "https://mail.google.com" | |
repeat with tabList in windowList | |
set tabList to tabList as any | |
repeat with tabItr in tabList | |
set tabItr to tabItr as any | |
delete tabItr | |
end repeat | |
end repeat | |
end tell |
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
ActionDispatch::Request.any_instance.stub(:remote_ip).and_return("192.168.0.1") |
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
# pigz is "A parallel implementation of gzip for modern multi-processor, multi-core machines" | |
# See http://zlib.net/pigz/ | |
# On the receiving machine run this: | |
nc -w 10 SENDING_MACHINE_IP 7878 | pigz -d | tar x | |
# On the sending machine run this: | |
tar c FILENAME_HERE | pigz | nc -l 7878 | |
# You can compare the md5 checksum from both files after the transfer, |
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 each database: | |
ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; | |
# For each table: | |
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | |
# For each column: | |
ALTER TABLE table_name CHANGE column_name column_name VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | |
# (Don’t blindly copy-paste this! The exact statement depends on the column type, maximum length, and other properties. The above line is just an example for a `VARCHAR` column.) |
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/bash | |
# | |
# (Original gist from https://gist.github.com/jmervine/5407622/raw/nginx_w_lua.bash) | |
set -x | |
cd /tmp | |
if ! test -d /usr/local/include/luajit-2.0; then | |
echo "Installing LuaJIT-2.0.1." | |
wget "http://luajit.org/download/LuaJIT-2.0.1.tar.gz" |
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 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 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
gst | grep modified | awk '{print $3}' | xargs vim |
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
credentials_hash = { | |
aws_secret_access_key: "KEY", | |
aws_access_key_id: "ID" | |
} | |
route53 = Fog::DNS::AWS.new(credentials_hash) | |
resource_record_sets = route53.list_resource_record_sets("ZONE_ID") | |
data = resource_record_sets.data[:body]["ResourceRecordSets"] | |
redis_resource_record = data.detect { |record_set| record_set["Name"] == "record_name_with_a_dot_at_the_end." } | |
former_cname_entry = redis_resource_record["ResourceRecords"].first |
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
ps aux | grep PROCESS_NAME | grep -v grep | awk '{print $2}' | xargs kill -9 |
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
1.) Run in terminal: 'vim --version | grep clipboard' | |
2.) Make sure the output says +clipboard (-clipboard means it is not installed) | |
3.) Put the following in your vimrc: | |
" Enabling clipboard | |
set clipboard=unnamed | |
4.) Install vim through homebrew: 'brew install vim' | |
5.) Put an alias on vim in your bashrc/zshrc: alias vim="/usr/local/Cellar/vim/7.4.052/bin/vim" | |
6.) Check vim --version for clipboard value again |
NewerOlder