This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| # Hello, and welcome to makefile basics. | |
| # | |
| # You will learn why `make` is so great, and why, despite its "weird" syntax, | |
| # it is actually a highly expressive, efficient, and powerful way to build | |
| # programs. | |
| # | |
| # Once you're done here, go to | |
| # http://www.gnu.org/software/make/manual/make.html | |
| # to learn SOOOO much more. |
| #!/bin/bash | |
| # | |
| # Requires ftxdumperfuser from http://developer.apple.com/textfonts/download/ | |
| # | |
| # Usage: fixconsolas [files ...] | |
| # When called with no arguments, it attempts to operate on every TrueType | |
| # file in the current directory. | |
| # | |
| # References: | |
| # http://bandes-storch.net/blog/2008/12/21/consolas-controlled/#comment-2042 |
| <?php | |
| // add this to your php.ini | |
| // auto_prepend_file = /path/to/virtual.prepend.php | |
| $http_host = explode('.',$_SERVER['HTTP_HOST']); | |
| $__mod_vhost_alias_fix_doc_root = $_SERVER['DOCUMENT_ROOT'] . | |
| DIRECTORY_SEPARATOR . $http_host[0] . | |
| DIRECTORY_SEPARATOR . 'public'; | |
| if (is_dir($__mod_vhost_alias_fix_doc_root)) { |
| server { | |
| index index.php; | |
| set $basepath "/var/www"; | |
| set $domain $host; | |
| # check one name domain for simple application | |
| if ($domain ~ "^(.[^.]*)\.dev$") { | |
| set $domain $1; | |
| set $rootpath "${domain}"; |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| #!/bin/sh | |
| # the name of your Wireless interface. Might be en1 on some machines. | |
| AIRPORT="en0" | |
| # name of the wifi network | |
| WIFI_WORK="<name-of-your-office-wifi>"; | |
| if networksetup -getairportnetwork $AIRPORT | grep -i -a $WIFI_WORK ; | |
| then |
| SELECT `field` FROM `table` GROUP BY `field` HAVING count(field) > 1; | |
| -- Find duplicated values for the column `field` |
| mysqldump -u username -p --default-character-set=latin1 -N database > backup.sql | |
| mysql -u username -p --default-character-set=latin1 database < backup.sql |
| mysqldump -u(username) -p(password) (source database name) (table names...) | mysql -u(username) -p(password) (destination database name) |
| USE db2; | |
| CREATE TABLE table2 LIKE db1.table1; | |
| INSERT INTO table2 | |
| SELECT * FROM db1.table1; |