This file contains hidden or 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 | |
from myproject.main.models import Drug | |
def load_drugs(file_path): | |
"this loads the drugs from pipe delimited to my model" | |
reader = csv.reader(open(file_path), delimiter="|") | |
reader.next() # skip header row | |
for row in reader: | |
drug = Drug(rxcui=row[0], short_name=row[1], is_brand=row[2]) | |
drug.save() |
This file contains hidden or 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 | |
from myproject.main.models import Drug | |
def load_drugs(file_path): | |
"this loads the drugs from pipe delimited to my model" | |
for row in csv.reader(open(file_path), delimiter="|"): | |
drug = Drug(rxcui=row[0], short_name=row[1], is_brand=row[2]) | |
drug.save() |
This file contains hidden or 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
from django.db import models | |
class Drug(model.Model): | |
rxcui = models.IntegerField() | |
short_name = models.CharField(max_length=50) | |
is_brand = models.IntegerField(max_length=1) |
This file contains hidden or 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
" easier split window commands | |
nnoremap <C-h> <C-w>h | |
nnoremap <C-j> <C-w>j | |
nnoremap <C-k> <C-w>k | |
nnoremap <C-l> <C-w>l |
This file contains hidden or 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
jQuery('a.add-question').live('click', function(e) { | |
e.stopPropagation() | |
e.preventDefault() | |
var form_el = jQuery(this).parents('form') | |
var num_questions = form_el.find('.question').length | |
var new_question_el = form_el.find('.question:last').clone() | |
new_question_el.appendTo('.questions',form_el).hide().slideDown("fast") | |
new_question_el.find('label,select,input,textarea').each(function(e) { | |
var el = jQuery(this) |
This file contains hidden or 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
~/Dropbox/projects/chef: knife bootstrap ec2-174-129-78-190.compute-1.amazonaws.com -x ubuntu -i ~/.ec2/closedbracket-ssd.pem | |
Bootstrapping Chef on ec2-174-129-78-190.compute-1.amazonaws.com | |
ec2-174-129-78-190.compute-1.amazonaws.com E | |
ec2-174-129-78-190.compute-1.amazonaws.com : | |
ec2-174-129-78-190.compute-1.amazonaws.com Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) | |
ec2-174-129-78-190.compute-1.amazonaws.com | |
ec2-174-129-78-190.compute-1.amazonaws.com E | |
ec2-174-129-78-190.compute-1.amazonaws.com : | |
ec2-174-129-78-190.compute-1.amazonaws.com Unable to lock directory /var/lib/apt/lists/ | |
ec2-174-129-78-190.compute-1.amazonaws.com |
This file contains hidden or 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
patients = Patient.create([ | |
{ | |
name: "Boris the Blade", | |
age: 999, | |
gender: "MALE", | |
hpi: "Also known as Boris the bullet dodger", | |
ethnicity: "WHITE" | |
}, | |
{ | |
name: "Turkish", |
This file contains hidden or 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
# A sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do | |
watch('config/application.rb') | |
watch('config/environment.rb') | |
watch(%r{^config/environments/.+\.rb$}) | |
watch(%r{^config/initializers/.+\.rb$}) | |
watch('Gemfile') | |
watch('Gemfile.lock') |
This file contains hidden or 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
VALUE | |
rb_str_intern(VALUE s) | |
{ | |
VALUE str = RB_GC_GUARD(s); | |
ID id; | |
id = rb_intern_str(str); | |
return ID2SYM(id); | |
} |
This file contains hidden or 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
.bundle | |
db/*.sqlite3 | |
log/*.log | |
tmp/ | |
doc/api | |
doc/app | |
*.swp | |
*~ | |
.DS_Store | |
.livereload |