Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
| <title>Archimedean Spiral</title> | |
| <script type="text/javascript" src="http://d3js.org/d3.v2.js"></script> | |
| <style> | |
| body { | |
| font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', 'Verdana', sans-serif; | |
| margin: 40px; |
| // This is the core Javascript code for http://windhistory.com/ | |
| // I haven't done a full open source release, but I figured I'd put the most important | |
| // D3 code out there for people to learn from. [email protected] | |
| /** Common wind rose code **/ | |
| // Function to draw a single arc for the wind rose | |
| // Input: Drawing options object containing | |
| // width: degrees of width to draw (ie 5 or 15) | |
| // from: integer, inner radius |
| ] wc -l domains.txt | |
| 783 domains.txt | |
| ] time go run domain_lookup_parallel.go | |
| real 0m5.743s | |
| user 0m0.359s | |
| sys 0m0.355s | |
| ] time go run domain_lookup_sequential.go |
| Handlebars.JavaScriptCompiler.prototype.nameLookup = function(parent, name, type) { | |
| var result = '(' + parent + ' instanceof Backbone.Model ? ' + parent + '.get("' + name + '") : ' + parent; | |
| if (/^[0-9]+$/.test(name)) { | |
| return result + "[" + name + "])"; | |
| } else if (Handlebars.JavaScriptCompiler.isValidJavaScriptVariableName(name)) { | |
| return result + "." + name + ')'; | |
| } else { | |
| return result + "['" + name + "'])"; | |
| } | |
| }; |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| # | |
| # Working with branches | |
| # | |
| # Get the current branch name (not so useful in itself, but used in | |
| # other aliases) | |
| branch-name = "!git rev-parse --abbrev-ref HEAD" | |
| # Push the current branch to the remote "origin", and set it to track | |
| # the upstream branch | |
| publish = "!git push -u origin $(git branch-name)" |
Layout of US House & Senate members in an arc using D3. Based on code from http://en.wikipedia.org/wiki/User_talk:Slashme/parliament.py
A Pen by Liji Jinaraj on CodePen.
| # alias to edit commit messages without using rebase interactive | |
| # example: git reword commithash message | |
| reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f" | |
| # completely wipe git history | |
| wipe-history = "!f() { git add . && git reset --soft $(git rev-list --max-parents=0 HEAD) && git commit --amend -m \"${1:-sup}\" && git push --force; }; f" | |
| # squash the last N commits | |
| squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f" |