Skip to content

Instantly share code, notes, and snippets.

View devhero's full-sized avatar
😁

Andrea Parisi devhero

😁
  • devhero
  • Milan
View GitHub Profile
@devhero
devhero / pg_listen_tcpip
Created August 1, 2015 10:23
postgres listen tcp-ip
# ubuntu
/etc/postgresql/9.1/main
# centos
/var/lib/pgsql/9.x/data
postgresql.conf
listen_addresses = '*'
pg_hba.conf
host all all 0.0.0.0/0 md5
# INSTALL FROM BINARIES
wget https://nodejs.org/dist/v0.12.7/node-v0.12.7-linux-x64.tar.gz
sudo tar --strip-components 1 -xzvf node-v* -C /usr/local
# EPEL RELEASE
sudo yum install epel-release
sudo yum install nodejs
# COMPILE
wget https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz
yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
yum install postgresql94-server postgresql94-contrib postgresql-devel
service postgresql-9.4 initdb
chkconfig postgresql-9.4 on
# MANAGE
service postgresql-9.4 start
service postgresql-9.4 stop
service postgresql-9.4 restart
@devhero
devhero / github_git_clone
Created August 1, 2015 07:53
github git clone
HTTPS
git clone https://[email protected]/username/repo.git
insert password
GIT
register ssh key
git clone [email protected]:username/repo.git
@devhero
devhero / rails_verify_server_version
Created July 27, 2015 13:38
rails console stay still: error verify_server_version
spring stop
bin/spring
rails c
@devhero
devhero / rails_install.txt
Last active August 29, 2015 14:25
ruby on rails installation
#install rvm, ruby
...
# install rails
gem install rails
# create project_folder, goto into folder
rails new . --database=postgresql
# edit database.yml filling username, passowrd, host, port
The Role of Deliberate Practice in the Acquisition of Expert Performance
by James Somers, February 9, 2010
I have just finished reading a famous paper by Ericsson, Krample, and Tesch-Romer called “The Role of Deliberate Practice in the Acquisition of Expert Performance” (1993, Psychological Review).
The paper’s key claim is that performance—be it in chess, or swimming, or violin—is a monotonic function of accumulated deliberate practice. More deliberate practice equals better performance.
So what is “deliberate” practice, and how is it different from the regular kind?
The most cited condition concerns the subjects’ motivation to attend to the task and exert effort to improve their performance. In addition, the design of the task should take into account the preexisting knowledge of the learners so that the task can be correctly understood after a brief period of instruction. The subjects should receive immediate informative feedback and knowledge of results of their performance. The subjects should repeat
@devhero
devhero / node_watch_ENOSPC.js
Created July 24, 2015 09:06
Error: watch ENOSPC
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
message = MyMailer.new_products(c, products)
customers.each do |c|
mail = message.dupe()
mail.to = c.email
mail.deliver
end
File.open(file_path, 'r') do |f|
send_data f.read, type: "text/excel"
end
File.delete(file_path)