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
SET FOREIGN_KEY_CHECKS=0; |
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 --compact | |
--skip-add-locks | |
--skip-lock-tables | |
--ignore-table=TABLE1 | |
--ignore-table=TABLE2 | |
-h HOST | |
-u USER | |
-p | |
DATABASE_NAME | gzip > DUMPFILE.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
Feature: Testing a web site with Capybara and Cucumber | |
Useful resources: | |
The Cucumber wiki: https://github.com/cucumber/cucumber/wiki | |
Capybara RDocs: http://rubydoc.info/github/jnicklas/capybara/file/README.md | |
Rspec RDocs: http://rubydoc.info/github/rspec/rspec/frames | |
The Cucumber Book: http://pragprog.com/book/hwcuc | |
Ruby Toolbox for Gem Selection: https://www.ruby-toolbox.com/ | |
Interesting discussion of Cucumber and BDD: http://gfxmonk.net/2011/01/26/how-i-replaced-cucumber.html | |
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
//Table1 has two foreign keys to Table2 | |
abstract class Table1 extends Doctrine_Record { | |
public function setUp() { | |
//... | |
$this->hasOne('Table2 as FirstAlias', array( | |
'local' => 'table2_id_first', | |
'foreign' => 'id')); |
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
sys.stdout.write('1') | |
sys.stdout.write('2') |
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
writer = csv.DictWriter(csvfile, header_list) | |
writer.writerow(dict((h,h) for h in header_list)) |
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
import csv | |
f = open('mycsv.csv','r') | |
try: | |
reader = csv.reader(f) | |
for row in reader: | |
print row | |
finally: | |
f.close() |
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
import md5 | |
import datetime | |
def output_line(line): | |
timestamp = datetime.datetime.today().strftime("%Y-%d-%m %H:%M:%S") | |
print(timestamp + ': ' + line) | |
output_line("Starting program...") | |
list_file = open('mp3_list.txt','r') | |
counter = 0 |
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
#In /etc/hosts | |
127.0.0.1 testsite.localdomain |
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
# Little script that stashes outstanding changes, performs an svn dcommit, and pops the stash | |
git_stashed=0 | |
git diff-index --quiet HEAD > /dev/null | |
if [ $? -eq 1 ] | |
then | |
echo "Stashing current work..." | |
git stash | |
git_stashed=1 | |
fi |
OlderNewer