rails new my_app -T -d postgresql
Add:
/* Border */ | |
border: 5px solid #eee; | |
/* Border-Radius */ | |
-webkit-border-radius: 10px; | |
-moz-border-radius: 10px; | |
border-radius: 10px; | |
/* Gradient */ | |
background: #fff; |
var elements = document.getElementsByClassName('section'); | |
Array.prototype.forEach.call(elements, function(element) { | |
element.style.backgroundColor = Please.make_color({ format: 'rgb-string' }); | |
}); |
# lib/tasks/db.rake | |
namespace :db do | |
desc "Dumps the database to db/APP_NAME.dump" | |
task :dump => :environment do | |
cmd = nil | |
epoch = Time.now.to_i | |
with_config do |app, host, db, user| | |
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}-#{epoch}.dump" | |
end |
http://www.austinstory.com/integrating-wicked-pdf-paperclip-and-mercury-rails-for-an-editable-web-document-that-can-be-exported-to-pdf/ | |
http://botreeconsulting.com/wicked_pdf-generate-pdf-from-haml-template/ | |
https://gist.github.com/micahroberson/5988843 | |
http://snikt.net/blog/2012/04/26/wicked-pdf/ | |
http://www.sitepoint.com/pdf-generation-rails/ |
#!/bin/bash | |
readonly lm75=0x48 # Slave address with A0, A1, and A2 set to 0v (ground). | |
while [ $# -gt 0 ] | |
do | |
if [ "$1" == "-debug" ] | |
then | |
debug=true | |
fi |
#!/bin/bash | |
while true; | |
do | |
i2cget -y 1 0x48 0x00 w | | |
awk '{printf("%.1f\n", (a=( \ | |
(("0x"substr($1,5,2)substr($1,3,1))*0.0625)+0.1) \ | |
)>128?a-256:a)}' |
emailRegex = /^[a-z0-9!#$%&'+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-][a-z0-9])?(.a-z0-9?)*$/i; | |
registration : FormGroup; | |
constructor(r: FormBuilder, public http :Http){ | |
this.registration = r.group({ | |
'chosen_username' : [null, Validators.required], | |
'chosen_email' : [null, Validators.pattern(this.emailRegex)], | |
'chosen_password' : [null, Validators.required], | |
}); | |
} |
<div *ngFor="let item of data | async"> | |
{{ item.data }} | |
</div> |