#Export Table as CSV From MySQL
SELECT * INTO OUTFILE '/tmp/my_table_name.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n' FROM my_table_name;
| ApplicationController.allow_forgery_protection = false | |
| app.post('/whatever_my_user_model_is/sign_in', {"whatever_my_user_model_is"=>{"email"=>"[email protected]", "password"=>"users_password"}}) |
| import xml.dom.minidom | |
| dom = xml.dom.minidom.parse("sitemap.xml") | |
| loc = dom.getElementsByTagName('loc') | |
| for node in loc: | |
| print node.firstChild.data |
| # An implementation of assert. | |
| AssertException = (message) -> | |
| @message = message | |
| assert = (exp, message) -> | |
| throw new AssertException(message) unless exp | |
| AssertException::toString = -> | |
| "AssertException: " + @message | |
#Export Table as CSV From MySQL
SELECT * INTO OUTFILE '/tmp/my_table_name.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n' FROM my_table_name;
| > 5[0] | |
| => 1 | |
| > 5[1] | |
| => 0 | |
| > 5[2] | |
| => 1 | |
| > 5[3] | |
| => 0 |
| \documentclass[12pt]{article} | |
| \usepackage{sectsty} | |
| \usepackage{fullpage} | |
| \usepackage[light,math]{kurier} | |
| \usepackage[T1]{fontenc} | |
| \begin{document} | |
| \thispagestyle{empty} |
| config.action_mailer.delivery_method = :smtp | |
| config.action_mailer.smtp_settings = { | |
| :address => "mail.our_clients_domain.com", | |
| :port => 25, | |
| :domain => 'our_clients_domain.com', | |
| :user_name => 'whatever_system_user_we_chose@our_clients_domain.com', | |
| :password => 'this_should_be_a_relatively_good_password', | |
| :authentication => 'plain', | |
| #:enable_starttls_auto => false | |
| } |
#Dump and Restore MySQL DB Quick Ref
##Dump The MySQL Table
mysqldump -u username -p -r my_output.sql my_database
##Compress Output with 7zip using the PPMd Algorithm
7z a -t7z my_output.7z my_output.sql -m0=PPMd
| /* | |
| Get acceleration data from Chronos watch. | |
| Taken from info posted at: http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/32714.aspx | |
| Based off of the latest Python code on the Chronos wiki that I wrote. | |
| Copyright (c) 2010 Sean Brewer | |
| Permission is hereby granted, free of charge, to any person | |
| obtaining a copy of this software and associated documentation |
| #For some reason, this took forever to figure out... | |
| passenger start -a 127.0.0.1 -p 3000 -d -e production |