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
rails 3.1 java runtime error | |
gem 'execjs' | |
gem 'therubyracer' |
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
sudo apt-get install libxslt1-dev | |
libxml, libxml-dev, libxslt, libzslt-dev |
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
SHOW DATABASES; - список баз данных | |
SHOW TABLES [FROM db_name]; - список таблиц в базе | |
SHOW COLUMNS FROM таблица [FROM db_name]; - список столбцов в таблице | |
SHOW CREATE TABLE table_name; - показать структуру таблицы в формате "CREATE TABLE" | |
SHOW INDEX FROM tbl_name; - список индексов | |
SHOW GRANTS FOR user [FROM db_name]; - привилегии для пользователя. | |
SHOW VARIABLES; - значения системных переменных | |
SHOW [FULL] PROCESSLIST; - статистика по mysqld процессам |
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
rvm implode | |
rm ~/.rvmrc | |
curl -s https://rvm.beginrescueend.com/install/rvm -o rvm-installer ; chmod +x rvm-installer ; ./rvm-installer --version 1.8.0 | |
; | |
rvm implode | |
gem uninstall rvm |
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
class Widget < ActiveRecord::Base | |
has_many :widget_groupings | |
has_many :people, :through => :widget_groupings, :source => :grouper, :source_type => 'Person' | |
has_many :aliens, :through => :widget_groupings, :source => :grouper, :source_type => 'Alien' | |
end | |
class Person < ActiveRecord::Base | |
has_many :widget_groupings, :as => grouper | |
has_many :widgets, :through => :widget_groupings |
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
sudo add-apt-repository ppa:webupd8team/sublime-text-2 | |
sudo apt-get update | |
sudo apt-get install sublime-text-2 |
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
ctrl+a or Home - Moves the cursor to the start of a line. | |
ctrl+e or End - Moves the cursor to the end of a line. | |
ctrl+b - Moves to the beginning of the previous or current word. | |
ctrl+k - Deletes from the current cursor position to the end of the line. | |
ctrl+u - Deletes the whole of the current line. | |
ctrl+w - Deletes the word before the cursor. |
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
sudo port install git-core +bash_completion | |
if [ -f /opt/local/etc/bash_completion ]; then | |
. /opt/local/etc/bash_completion | |
fi | |
GIT_PS1_SHOWDIRTYSTATE=true | |
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;33m\]\w\[\033[00m\]\[\033[01;31m\]$(__git_ps1 " {%s}")\[\033[00m\]\$ ' |
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
mkdir -p /Library/Application\ Support/TextMate/Bundles | |
cd !$ | |
git clone git://github.com/timcharper/git-tmbundle.git Git.tmbundle | |
osascript -e 'tell app "TextMate" to reload bundles' | |
Ctr+Shift+G => blame | |
enjoy! |
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
import sublime, sublime_plugin | |
import os | |
class DetectFileTypeCommand(sublime_plugin.EventListener): | |
""" Detects current file type if the file's extension isn't conclusive """ | |
""" Modified for Ruby on Rails and Sublime Text 2 """ | |
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
def on_load(self, view): | |
filename = view.file_name() |
OlderNewer