###SUMMARY: Twitter.com "compose" text area undo granularity is seriously broken (far too coarse-grained).
###CONTEXT: OS X 10.8.5
Any Browser of:
- Chrome Version 31.0.1650.8 beta
- Safari Version 6.0.5 (8536.30.1)
- Firefox 24
###SUMMARY: Twitter.com "compose" text area undo granularity is seriously broken (far too coarse-grained).
###CONTEXT: OS X 10.8.5
Any Browser of:
var promises = [ | |
async1(), | |
async2(), | |
… | |
asyncN() | |
]; | |
/* jQuery: warning, won't swallow exceptions */ | |
var deferred = $.Deferred(); | |
$.when.apply($, promises) | |
.done(function () { deferred.resolve(promises); }) |
/*! | |
* jQuery JavaScript Library v2.1.1pre | |
* http://jquery.com/ | |
* | |
* Includes Sizzle.js | |
* http://sizzlejs.com/ | |
* | |
* Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors | |
* Released under the MIT license | |
* http://jquery.org/license |
Computes a new version of a String value in which certain characters have been escaped, so that the regular expression engine will interpret any metacharacters that it may contain as character literals.
When the escape function is called with one argument string, the following steps are taken:
# | |
# I use SSH URLs in my submodules for convenience. However, Travis CI is unable to | |
# clone from those URLs even though the repositories are public. To fix this, I'm | |
# simply manipulating the .gitmodules file with sed so it points to the public | |
# URLs before initializing the submodules. | |
# | |
# Hope it saves you some frustration! | |
# | |
# disable the default submodule logic |
$ history | grep git | awk '{print $3}' | sort | uniq -c | sort -rn | head | |
127 st | |
53 dif | |
46 add | |
33 co | |
23 commit | |
16 push | |
12 pull | |
12 merge | |
10 br |
com -bang Q q<bang> | |
com -bang W w<bang> <args> | |
com -bang WQ wq<bang> <args> | |
com -bang Wq wq<bang> <args> |
#!/usr/bin/env ruby | |
remote_url = `git config --get remote.origin.url`.strip | |
matches = remote_url.match(/github\.com:(.+)\/(.+)\.git/) | |
if matches | |
branch_name = `git rev-parse --abbrev-ref HEAD`.strip | |
exec "open https://github.com/#{matches[1]}/#{matches[2]}/compare/#{branch_name}?expand=1" | |
end | |
# Save this file as ~/bin/git-pr and then `chmod +x ~/bin/git-pr`. |
update
I've created a little repository that simply exposes the final utility as npm
module.
It's called html-escaper
there is basically one rule only: do not ever replace one char after another if you are transforming a string into another.