- Download the perforce visual tool suite from here: http://www.perforce.com/perforce/downloads/index.html
- Copy only the p4merge.app file into your /Applications/ directory
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
// Here my collection is named articles | |
// I'm changing the blog_name field in every document in that collection to lowercase | |
db.articles.find().forEach(function(doc){if(typeof(doc.blog_name) == 'string') {doc.blog_name = doc.blog_name.toLowerCase(); db.articles.save(doc); }}) |
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
# Assume your svn repo is located at svn://example.com/myapp/trunk | |
# Assume your git repo will be located at [email protected]:example/myapp.git | |
# First you need to generate a list of all committers in your svn tree. | |
# Credit David Wheeler | |
# http://www.justatheory.com/computers/tricks/list-all-svn-committers.html | |
$ svn log --quiet svn://example.com/myapp/trunk | grep '^r' | awk '{print $3}' | sort -u | |
# Next, create a file in your home directory named svn-committers following this format | |
mojombo = Tom Preston-Werner <[email protected]> |
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 i in `git status -s | sed -e 's/^.* //'`; do php -l $i; 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
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; Xbox) |
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 | |
/* | |
exit codes: | |
0 - everything ok. | |
1 - failure to connect | |
*/ | |
if ( ! extension_loaded('memcache') ) { | |
die("memcache pecl module is not available. Please install a STABLE version from http://pecl.php.net/package/memcache"); | |
} |
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
mysqldump -u [user_name] -p -Qce --max-allowed-packet=1024M -B [database_name] > database_name.sql |
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
# first download and install virtual box | |
curl -O http://download.virtualbox.org/virtualbox/4.2.12/VirtualBox-4.2.12-84980-OSX.dmg | |
# Then install ie8, 9 & 10 vms | |
curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | env IEVMS_VERSIONS="8 9 10" bash |
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
mysqldump -u [user] -p -xQce -R --master-data=2 --max-allowed-packet=1024M -B [db_name] | gzip > [db_name].sql.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
#!/bin/bash | |
# No username or passwords in this script, you should use mysql_config_editor | |
# to store it securely. The login-path in this script is set to "local-backup" so when you create | |
# your .mylogin.cnf with the mysql-config-editor make sure it is set the same | |
# See http://dev.mysql.com/doc/refman/5.6/en/mysql-config-editor.html | |
# An example to create your config for a mysql user "backup": | |
# shell> sudo mysql_config_editor set --login-path=local-backup --host=localhost --user=backup --password | |
# The backup user in the mysql server needs these privileges: SELECT, RELOAD, SHOW DATABASES, REPLICATION CLIENT |
OlderNewer