Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
namespace :db do desc "Backup project database. Options: DIR=backups RAILS_ENV=production MAX=7" | |
task :backup => [:environment] do | |
datestamp = Time.now.strftime("%Y-%m-%d_%H-%M-%S") | |
base_path = Rails.root | |
base_path = File.join(base_path, ENV["DIR"] || "backups") | |
backup_base = File.join(base_path, 'db_backups') | |
backup_folder = File.join(backup_base, datestamp) | |
backup_file = File.join(backup_folder, "#{RAILS_ENV}_dump.sql") | |
FileUtils.mkdir_p(backup_folder) | |
db_config = ActiveRecord::Base.configurations[RAILS_ENV] |
#!/bin/sh | |
export JDK_HOME=/usr/lib/jvm/java-6-sun | |
cd /home/marius/.RubyMine31/bin | |
exec ./rubymine.sh |
.ui-autocomplete { | |
position: absolute; | |
top: 100%; | |
left: 0; | |
z-index: 1000; | |
float: left; | |
display: none; | |
min-width: 160px; | |
_width: 160px; | |
padding: 4px 0; |
# | |
# Install the MYSQL driver | |
# gem install mysql2 | |
# | |
# Ensure the MySQL gem is defined in your Gemfile | |
# gem 'mysql2' | |
# | |
# And be sure to use new-style password hashing: | |
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
development: |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
sudo apt-get install -y php-pear php5-dev | |
sudo pecl install mongo | |
sudo sh -c "echo 'extension=mongo.so' > /etc/php5/mods-available/mongo.ini" | |
sudo ln -s /etc/php5/mods-available/mongo.ini /etc/php5/apache2/conf.d/mongo.ini | |
sudo service apache2 restart |
All the steps below came from watching the Railscast below:
http://railscasts.com/episodes/274-remember-me-reset-password
The steps below assumes that your app already has a user and user authentication set up.
<p><%= link_to 'Forgot password?', new_password_reset_path %></p>
<?php | |
$nilai_angka = 85; | |
$mata_kuliah = 'Pemrograman Web Lanjut'; | |
if ($nilai_angka > 80) { | |
$nilai_huruf = 'A'; | |
$ket = 'Lulus'; | |
} elseif ($nilai_angka > 60) { | |
$nilai_huruf = 'B'; | |
$ket = 'Lulus'; | |
} elseif ($nilai_angka > 50) { |
do it .. | |
gem 'mysql2', '~> 0.3.18' this gem works with rails version 4.x.x | |
if install gem 'mysql2', '~> 0.4.0' it produces gem load error | |
referense | |
https://github.com/rails/rails/issues/21544 |
gem 'rails_12factor'
to your Gemfile. This will add error logging and the ability for your app to serve static assets.bundle
RAILS_ENV=production rake db:create db:migrate db:seed
rake secret
and copy the outputexport SECRET_KEY_BASE=output-of-rake-secret
rake assets:precompile
. This will create a folder public/assets
that contains all of your assets.RAILS_ENV=production rails s
and you should see your app.Remember to clobber your assets (rake assets:clobber
) and re-precompile (rake assets:precompile
) if you make changes.