Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| # Set the control character to Ctrl+Spacebar (instead of Ctrl+B) | |
| set -g prefix C-space | |
| unbind-key C-b | |
| bind-key C-space send-prefix | |
| # Set new panes to open in current directory | |
| bind c new-window -c "#{pane_current_path}" | |
| bind '"' split-window -c "#{pane_current_path}" | |
| bind % split-window -h -c "#{pane_current_path}" |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative
float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
| var os = require('os'); | |
| var path = require('path'); | |
| var randomDir = function() { | |
| return path.join(os.tmpdir(), String(Math.floor(Math.random()*1000))); | |
| }; | |
| var openit = function(url) { | |
| var chromeLocation = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'; | |
| var args = [ |
| window.console.clog = function(log){ | |
| var message = typeof log === 'object' ? '%cLooks like you\'re trying to log an ' : '%cLooks like you\'re trying to log a ', | |
| style = 'background:url(http://i.imgur.com/SErVs5H.png);padding:5px 15px 142px 19px;line-height:280px;'; | |
| console.log.call(console, message + typeof log + '.', style); | |
| }; |
Yet another framework syndrome
| Name | Date | URL | Stars |
|---|---|---|---|
| Jake | April 2010 | https://github.com/mde/jake | 1000 |
| Brunch | January 2011 | http://brunch.io/ | 3882 |
| # npm publish with goodies | |
| # prerequisite: `npm install -g trash` | |
| # `np` with an optional argument `patch`/`minor`/`major`/`<version>` | |
| # defaults to `patch` | |
| np() { | |
| trash node_modules &>/dev/null; | |
| git pull --rebase && | |
| npm install && | |
| npm test && | |
| npm version ${1:-patch} && |