# Provides Xvfb
zypper in xorg-x11-server-sdk
wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2
tar -xjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2
cp wkhtmltopdf-amd64 /usr/bin/wkhtmltopdf
# Az alap koncepció innen származik: http://stackoverflow.com/questions/953481/restore-a-deleted-file-in-a-git-repo | |
# Csak a törölt fájlokat akarom visszaállítani a módosítottakat nem (ezt a grep 'D' és cut kombináció biztosítja) | |
# Elméleti: | |
git co $(git rev-list -n 1 HEAD -- <file_path>)~1 -- $(git diff --name-status $(git rev-list -n 1 HEAD -- <file_path>)~1 head | grep '^D' | cut -f 2) | |
# Egysorban az egész db könyvtáron mint példa: | |
git co $(git rev-list -n 1 HEAD -- db)~1 -- $(git diff --name-status $(git rev-list -n 1 HEAD -- db)~1 head | grep '^D' | cut -f 2) |
# http://stackoverflow.com/questions/3801321/git-list-only-untracked-files-also-custom-commands | |
git ls-files --other --exclude-standard app/views/ | xargs rm | |
git ls-files -z -o --exclude-standard | xargs -0 git add | |
git clean -df |
http://www.kolodvor.net/2010/01/02/rails-csrf-and-ajax-requests/ | |
http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html#M000514 | |
http://stackoverflow.com/questions/5241213/rails-session-is-blank-when-using-http-put | |
Key thing is to add form_authenticity_token to path param as a query_string | |
http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to | |
<%= link_to 'Reset', null_counter_model_path(model, :authenticity_token => form_authenticity_token), :confirm => 'Are you sure?', :method => :put, :remote => true %> |
http://stackoverflow.com/questions/68569/text-watermark-on-website-how-to-do-it | |
<style type="text/css"> | |
#watermark { | |
color: #d0d0d0; | |
font-size: 200pt; | |
-webkit-transform: rotate(-45deg); | |
-moz-transform: rotate(-45deg); | |
position: absolute; | |
width: 100%; |
# Creating view or temp table | |
ActiveRecord::Base.connection.execute("CREATE TEMPORARY TABLE users#{args.offset} SELECT * FROM users LIMIT #{limit} OFFSET #{(args.offset - 1) * limit}") | |
# or | |
ActiveRecord::Base.connection.execute("CREATE VIEW users#{args.offset} AS SELECT * FROM users LIMIT #{limit} OFFSET #{(args.offset - 1) * limit}") | |
### Giving relation back, suitable for find_in_batches | |
#User.arel_table.name ='users2' | |
# This changes table name in FROM part of the query |
Other great tool: | |
https://launchpad.net/mysql-tuning-primer | |
Hack MySQL ‹ mysqlreport ‹ Download ‹ Guide › Documentation | |
Blog Contact Sitemap | |
This web site is no longer maintained. Read why. |
http://en.gentoo-wiki.com/wiki/KVM | |
http://alanlam.blogspot.com/2011/12/gentoo-guest-using-virtio.html |
#http://stackoverflow.com/questions/454427/bash-string-difference | |
diff <( echo "b27947f3045220faf16e4d9158cbfe13") <( md5sum php-5.2.17.tar.bz2 | cut -d' ' -f 1) |
http://geekystuff.net/2009/01/14/remove-all-ruby-gems/ |