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
function Something(attr) { | |
this.attr = attr; | |
this.doSomething(); | |
this.initSomething(); | |
$(this.activator).bind('click', {editor: this}, this.clickHandler); | |
}; | |
Something.prototype = { | |
doSomething: function() { | |
// blabla bla |
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
:w !sudo tee % |
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
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" |
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
#!/bin/bash | |
for F in `ls ~/.gem/ruby/1.8/gems` | |
do | |
GEM=${F%-*} | |
gem uninstall $GEM -a -x -I --install-dir ~/.gem/ruby/1.8/ | |
done |
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
# IST DO SCREENU, aby si pri tom nemusel nocovat!!! | |
# ideme odobrat najnovsi dump z MASTERA (je jedno na ktorom stroji sme - mozno je vyhodnejsie byt na slave-ovi): | |
# priprava na dump a vynulovanie binary logov | |
mysql -h db-master -u root -p | |
FLUSH TABLES WITH READ LOCK; | |
RESET MASTER; | |
PURGE BINARY LOGS; | |
UNLOCK TABLES; |
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
<% [:notice, :error, :alert].each do |level| %> | |
<% unless flash[level].blank? %> | |
<div class="alert-message <%= flash_class(level) %>"> | |
<a class="close" href="#">×</a> | |
<%= content_tag :p, flash[level] %> | |
</div> | |
<% end %> | |
<% 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
require 'csv' | |
# http://ruby-doc.org/stdlib-1.9.2/libdoc/csv/rdoc/CSV.html | |
# READING !!!FROM FILE!!!! | |
# Line by Line: | |
CSV.foreach('csvfile.csv') do | |
|row| | |
puts row #array | |
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
c = ActiveRecord::Base.connection | |
c.tables.collect do |t| | |
columns = c.columns(t).collect(&:name).select {|x| x.ends_with?("_id" || x.ends_with("_type"))} | |
indexed_columns = c.indexes(t).collect(&:columns).flatten.uniq | |
unindexed = columns - indexed_columns | |
unless unindexed.empty? | |
puts "#{t}: #{unindexed.join(", ")}" | |
end | |
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
#git cherry-pick aabce18 | |
# ORACLE: | |
cd ~/workspace/webafis_rails | |
cp ../_webafis_related/database_yml/ES/database.yml.oracle ES/config/database.yml | |
cp ../_webafis_related/database_yml/DS/database.yml.oracle DS/config/database.yml | |
# POSTGRES: | |
cd ~/workspace/webafis_rails | |
cp ../_webafis_related/database_yml/ES/database.yml.postgres ES/config/database.yml | |
cp ../_webafis_related/database_yml/DS/database.yml.postgres DS/config/database.yml |
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
ruby -e 'puts `echo $PATH`.split ":"' |
OlderNewer