Archived. Please see https://www.sainnhe.dev/post/status-line-config
First of all, install a nerd font, and apply it: nerd font
First of all, install a nerd font, and apply it: nerd font
| # GIT heart FZF | |
| # ------------- | |
| is_in_git_repo() { | |
| git rev-parse HEAD > /dev/null 2>&1 | |
| } | |
| fzf-down() { | |
| fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@" | |
| } |
| // See: http://stackoverflow.com/questions/11531353/viewing-nsdata-contents-in-xcode#25097265 | |
| po String(data: data, encoding: .utf8) | |
| // Objective-C equivalent. | |
| // See: http://stackoverflow.com/questions/11531353/viewing-nsdata-contents-in-xcode#19626815 | |
| // p (char *)[buffer bytes] |
| sudo sed -i -r 's/(\[.+\])$/\1\nStartupWMClass=Google-chrome-stable/g' /usr/share/applications/google-chrome.desktop |
| "use strict"; | |
| // `f` is assumed to sporadically fail with `TemporaryNetworkError` instances. | |
| // If one of those happens, we want to retry until it doesn't. | |
| // If `f` fails with something else, then we should re-throw: we don't know how to handle that, and it's a | |
| // sign something went wrong. Since `f` is a good promise-returning function, it only ever fulfills or rejects; | |
| // it has no synchronous behavior (e.g. throwing). | |
| function dontGiveUp(f) { | |
| return f().then( | |
| undefined, // pass through success |
| #!/bin/bash | |
| # node.js using PPA (for statsd) | |
| sudo apt-get install python-software-properties | |
| sudo apt-add-repository ppa:chris-lea/node.js | |
| sudo apt-get update | |
| sudo apt-get install nodejs npm | |
| # Install git to get statsd | |
| sudo apt-get install git |
| # coding: utf-8 | |
| # | |
| # Encode any codepoint outside the ASCII printable range to an HTML character | |
| # reference (https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_reference_overview). | |
| def encode(string) | |
| string.each_codepoint.inject("") do |buffer, cp| | |
| cp = "&#x#{cp.to_s(16)};" unless cp >= 0x20 && cp <= 0x7E | |
| buffer << cp | |
| end | |
| end |