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 | |
$host = 'localhost'; | |
$username = 'username'; | |
$password = 'password'; | |
$database = 'db'; | |
$prefix = 'wp_'; | |
$newPrefix = 'staging_'; | |
$link = mysql_connect($host, $username, $password); | |
mysql_select_db($database); |
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 su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS hstore;'" | |
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'" | |
sudo su - postgres -c "service postgresql stop" | |
sudo su - postgres -c '/usr/lib/postgresql/9.3/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.3/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.3/main/ -O "-c config_file=/etc/postgresql/9.3/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"' | |
sudo apt-get remove postgresql-9.1 postgresql-client-9.1 -y | |
sudo sed -i "s:5433:5432:g" /etc/postgresql/9.3/main/postgresql.conf | |
sudo service postgresql restart | |
sudo su - postgres -c '~/analyze_new_cluster.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
#!/usr/bin/env php | |
<?php | |
if ($_SERVER['argc'] < 2) { | |
echo 'Usage: ', basename(__FILE__), ' domain-name.com [domains...]'; | |
die; | |
} | |
foreach ($_SERVER['argv'] as $i => $domain) { | |
// 0 is the script name | |
if (0 === $i) { |
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
-- Replace new-domain and old-domain as with your values | |
SET @old_domain = '', | |
@new_domain = ''; | |
UPDATE `wp_options` | |
SET `option_value` = REPLACE ( | |
`option_value`, | |
@old_domain, | |
@new_domain | |
); |
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/sh | |
bold=$(tput bold) | |
normal=$(tput sgr0) | |
DIR=`pwd` | |
for project in $(find * -type d -maxdepth 0) | |
do | |
cd $project | |
if [ -d ".git" ] |
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 | |
apt-get update | |
apt-get dist-upgrade -y | |
apt-get autoremove -y | |
apt-get clean | |
apt-get autoclean | |
pip install -U pip virtualenvwrapper | |
npm update -g |
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 | |
$config = (object) array( | |
'db' => (object) array( | |
'host' => '127.0.0.1', | |
'username' => 'root', | |
'password' => '', | |
), | |
// Threshold for how "full" the int columns are, as a percentage. Since we | |
// deal with columns of different sizes, a fixed number isn't appropriate | |
'threshold' => 0.95, |
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 python | |
""" | |
Simple server to create OS notifications. | |
Example usage with Django: | |
To get a notification when the Django development server is running or has just | |
reloaded in resoonse to a code change, append this to `wsgi.py`: | |
``` | |
import requests | |
try: |
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/sh | |
# Usage: . ./macos-update.sh (so that upgrade_oh_my_zsh works) | |
echo 'Updating brew' | |
brew update | |
brew upgrade --all | |
brew cleanup | |
echo 'Updating shell' | |
upgrade_oh_my_zsh | |
echo 'Updating Docker and its images' | |
dinghy upgrade |
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
Show hidden characters
{ | |
"color_scheme": "Packages/User/SublimeLinter/base16-ocean.dark (SL).tmTheme", | |
"detect_indentation": true, | |
"dictionary": "Packages/Language - English/en_GB.dic", | |
"ensure_newline_at_eof_on_save": true, | |
"folder_exclude_patterns": | |
[ | |
".git", | |
".hg", | |
".idea", |
OlderNewer