Git pre-commit hook
- Remove whitespaces
- Find files containing FOCUS()
Copy this file in .git/hooks and make it executable
- chmod +x .git/hooks/pre-commit
function $(selector, context) { | |
return (context || document).querySelector(selector) | |
} | |
$.all = function (selector, context) { | |
return Array.prototype.slice.call( | |
(context || document).querySelectorAll(selector) | |
) | |
} |
Git pre-commit hook
Copy this file in .git/hooks and make it executable
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Brandon B. [email protected]
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
= t_scope(:"my.example.text") do |scope| | |
- scope.world do | |
span.worldly= my_world_helper | |
- scope.sign_up do | |
= link_to(scope.t(:sign_up), sign_up_path) | |
- scope.log_in do | |
= link_to(scope.t(:log_in), log_in_path) |
# Remove titlecase from submit tag default value. | |
# E.g. "Create User" -> "Create user". | |
class ActionView::Helpers::FormBuilder | |
def submit_default_value_with_titlecase_removal | |
old = submit_default_value_without_titlecase_removal | |
model = if object.class.respond_to?(:model_name) | |
object.class.model_name.human | |
else | |
@object_name.to_s.humanize |
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
window.tweetLoaded = (tweet) -> | |
document.querySelector('.tweet').innerHTML = tweet[0].text |
method PageHeaderHelper
def page_header(title, subtitle = nil, &contents)
PageHeader.new(self, title, subtitle, &contents)
end
class PageHeader
attr_reader :context, :title, :subtitle
def initialize(context, title, subtitle = nil)
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.