This file contains 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
mysql -u root -p | |
// No, you should run mysql -u root -p in bash, not at the MySQL command-line. If you are in mysql, you can exit by typing exit. |
This file contains 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
//In remote | |
➜ ~ tar czvf compressed.tar.gz directory1 | |
https://www.digitalocean.com/community/tutorials/an-introduction-to-file-compression-tools-on-linux-servers | |
//In Locale | |
➜ ~ scp -r username@ip:compressed.tar.gz /Users/johndoe/Desktop/backup.tar.gz |
This file contains 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
$('.table').footable({ | |
"toggleColumn": "last", | |
"expandFirst": true, | |
"empty": "no results", | |
"columns": [ | |
{ "name": "id", "title": "ID", "breakpoints": "xs" }, | |
{ "name": "firstName", "title": "First Name" }, | |
{ "name": "lastName", "title": "Last Name" }, | |
{ "name": "jobTitle", "title": "Job Title", "breakpoints": "xs" }, | |
{ "name": "started", "title": "Started On", "breakpoints": "xs sm" }, |
This file contains 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
@models = Model.joins(:categories).where('categories.id = ?', @categories_id).order("created_at DESC").paginate(page: params[:page]) | |
This file contains 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
psql asdf_development < /Users/johndoe/Desktop/db_dump.sql |
This file contains 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
link_to "Comment wall", profile_path(@profile, :anchor => "wall") | |
// => <a href="/profiles/1#wall">Comment wall</a> | |
link_to "Ruby on Rails search", :controller => "searches", :query => "ruby on rails" | |
// => <a href="/searches?query=ruby+on+rails">Ruby on Rails search</a> | |
link_to "Nonsense search", searches_path(:foo => "bar", :baz => "quux") | |
// => <a href="/searches?foo=bar&baz=quux">Nonsense search</a> |
This file contains 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
after_save :update_subtotal | |
def calc_subtotal | |
order_items.includes(:model).collect {|oi| oi.valid? ? (oi.unit_price.to_f) : 0}.sum | |
end | |
def update_subtotal | |
self.update_column(:subtotal, calc_subtotal) | |
end |
This file contains 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
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n | |
tr: | |
devise: | |
confirmations: | |
confirmed: "Eposta adresiniz başırılı bir şekilde onaylandı." | |
send_instructions: "Bir kaç dakika içerisinde eposta adresinizi nasıl onaylayacağınız hakkında bir eposta alacaksınız." | |
send_paranoid_instructions: "Eğer eposta adresinizi veritabanımızda kayıtlı ise bir kaç dakika içerisinde eposta adresinizi nasıl onaylayacağınız hakkında bir eposta alacaksınız." | |
failure: | |
already_authenticated: "Zaten giriş yaptınız." |
This file contains 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
$('.tree li').show() | |
$('.tree li').on 'click', (e) -> | |
children = $(this).find('> ul > li') | |
if children.is(':visible') | |
children.hide 'fast' | |
else | |
children.show 'fast' | |
e.stopPropagation() | |
return | |
return |