This file contains hidden or 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 highlightingCurrentGutter(editor){ | |
var $collection_pre = $(editor.getGutterElement()).find('pre'); | |
$collection_pre.removeClass('active-gutter'); | |
$($collection_pre[editor.getCursor().line]).addClass('active-gutter'); | |
} | |
/* exemple d'utilisation */ | |
html_editor = CodeMirror.fromTextArea(html_code, { | |
lineNumbers: true, | |
matchBrackets: true, |
This file contains hidden or 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
# Launch Pry with access to the entire Rails stack. | |
# If you have Pry in your Gemfile, you can pass: ./script/console --irb=pry instead. | |
# If you don't, you can load it through the lines below :) | |
rails = File.join Dir.getwd, 'config', 'environment.rb' | |
if File.exist?(rails) && ENV['SKIP_RAILS'].nil? | |
require rails | |
if Rails.version[0..0] == "2" | |
require 'console_app' |
This file contains hidden or 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 the current git branch | |
COLOR_RESET="\033[00m" | |
RED="\033[0;31m" | |
YELLOW="\033[0;33m" | |
GREEN="\033[0;32m" | |
PS1='[\u@\h \W$(__git_ps1 " (\[$YELLOW\]%s\[$COLOR_RESET\])")]\$ ' |
This file contains hidden or 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
# dans application_controller | |
private | |
# Charge le layout qui porte le même nom que le Namespace | |
# retourne aucun layout si la requête est en AJAX | |
def choose_layout | |
namespace = self.class.name.split("::").first.downcase | |
(request.xhr?) ? nil : namespace | |
end |
NewerOlder