Keybase proof
I hereby claim:
- I am wkrsz on github.
- I am wojtekkruszewski (https://keybase.io/wojtekkruszewski) on keybase.
- I have a public key ASAF4xY0AiQYcyxkh_9sOKtzwrCbnYkZKJ817yCX7q3l9Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
config.middleware.use "Loggo" |
// http://stackoverflow.com/questions/12286332/twitter-bootstrap-remote-modal-shows-same-content-everytime | |
$(document).on('hidden.bs.modal', '.modal', function () { | |
var modalData = $(this).data('bs.modal'); | |
// Destroy modal if has remote source – don't want to destroy modals with static content. | |
if (modalData && modalData.options.remote) { | |
// Destroy component. Next time new component is created and loads fresh content | |
$(this).removeData('bs.modal'); | |
// Also clear loaded content, otherwise it would flash before new one is loaded. |
This shit has been bugging me for too long, so I went on a hunt and found a workaround. | |
The Symptoms are as follows: | |
* Clicking the address bar results in a 1-4 second delay | |
* Opening links in new tabs results in a 1-4 second delay | |
* +T results in a 1-4 second delay | |
* `PressAndHold[<pid>]: IMKServer Stall detected` is present in `/var/log/system.log` at the time of the hang. | |
It appears to be to do with the PressAndHold helper - the thing that shows an IOS style selection of accents when you hold a key down. | |
The fix may have some unwanted effects, I haven't really noticed any. |
Whenever you push to remote that has "production" in its name, | |
this hook will show commits and changes and then ask for confirmation. | |
Copy or symlink to .git/hooks/pre-push. | |
Deployment by pushing code to remote github repo are very convenient | |
but prone to accidents. I wanted something that would force me to | |
review what's being pushed. | |
My Bash-foo is very limited to suggestions for improvements are very welcome. |
class ExampleTest < ActionView::TestCase | |
test "example" do | |
helper_output = "<p class='error'>Yo!</p>" | |
parsed = HTML::Document.new(helper_output).root | |
assert_select parsed, "p.error" | |
end | |
end |
module SimpleForm | |
module Components | |
module ErrorLabel | |
def error_label | |
if has_errors? | |
@builder.label(label_target, error_text, label_html_options) | |
end | |
end | |
end | |
end |
// Bind to backbone attribute (read/write with get/set, subscribe to change:attribute event): | |
// data-text="model.@attribute" | |
// | |
// Bind to output of function (calls the function to get value, subscribes to 'change' event): | |
// data-text="model.computedProperty() | |
// | |
// Bind to attribute (subscribes to 'change' event): | |
// data-text="model.attr" | |
(function(rivets){ |
config.log_tags = [ | |
:remote_ip, | |
->(req){ | |
if user_id = WardenTaggedLogger.extract_user_id_from_request(req) | |
"#" + user_id.to_s | |
else | |
"guest" | |
end | |
} | |
] |