- YARD.
You likely won't use all the available tags (words starting with an @) shown in the bellow examples. These examples are more of a cheat sheet of what you can do and where you can use them.
#!/home/benoit/bin/bb | |
(def argument (first *command-line-args*)) | |
(->> argument | |
(#(str/split % #", ")) | |
(map #(str "\"" % "\"")) | |
(str/join ", ") | |
println | |
) |
You likely won't use all the available tags (words starting with an @) shown in the bellow examples. These examples are more of a cheat sheet of what you can do and where you can use them.
body = window.document.getElementsByTagName('body')[0]; | |
body.addEventListener('mouseenter', function(ev) { | |
ev.preventDefault; | |
if(ev.target.tagName !== 'TD') { | |
return; | |
} | |
ev.target.className = "bouya"; | |
}, true); |
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
Getting started:
Related tutorials:
# Source: http://timcardenas.com/automatically-reload-gems-in-rails-327-on-eve | |
# Inside config/environments/development.rb | |
# Do the following after every request to the server in development mode | |
ActionDispatch::Callbacks.to_cleanup do | |
# If the gem's top level module is currently loaded, unload it | |
if Object.const_defined?(:MyCoolGem) |
If you have your code defined in classes in lib/ folder you may have problems to load that code in production.
Autoloading is disabled in the production environment by default because of thread safety.
Change config/application.rb:
config.autoload_paths << Rails.root.join("lib")
config.eager_load_paths << Rails.root.join("lib")
if (!function_exists('monolog')) { | |
function monolog($var) { | |
$log = (new \Monolog\Logger('name'))->pushHandler(new \Monolog\Handler\ErrorLogHandler()); | |
$log->addInfo("Running controller"); | |
} | |
} | |
if (!function_exists('filelog')) { |
<type>(<scope>): <subject> | |
<body> | |
<footer> | |
#------------------------------------------------------------------------------- | |
# <type> | |
# - feat: A new feature | |
# - fix: A bug fix |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'handlers': { | |
'mail_admins': { | |
'level': 'ERROR', | |
'class': 'django.utils.log.AdminEmailHandler' | |
}, | |
'null': { | |
'level':'DEBUG', |