🏳️🌈
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://mrl.nyu.edu/~perlin/noise/ | |
var ImprovedNoise = function () { | |
var p = [151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10, | |
23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87, | |
174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211, | |
133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208, | |
89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5, | |
202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" == "0" ]; then | |
ag | |
exit 1 | |
fi | |
ag -S --nobreak --noheading --color-line-number='1;31' --color-path='0;31' --color-match='1;36' --depth=15 --ignore '*~' "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint no-var:0 */ | |
/* global AFRAME */ | |
'use strict'; | |
// Now out of date, use: | |
AFRAME.scenes[0].components.screenshot.capture() | |
// OLD METHOD BELOW: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (document.body.animate && typeof Animation === 'undefined') { | |
window.Animation = document.body.animate({}).constructor; | |
} | |
if (typeof Animation !== 'undefined' && Animation.prototype.finished === undefined) { | |
Object.defineProperty(Animation.prototype, 'finished', {get: function () { | |
if (this.__finishPromise) return this.__finishPromise; | |
if (this.playState === 'finished') { | |
this.__finishPromise = Promise.resolve(); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HTMLElementWithRefs extends HTMLElement { | |
constructor () { | |
super(); | |
this.refs = new Proxy({}, { | |
get: this.__getFromShadowRoot.bind(this) | |
}); | |
} | |
__getFromShadowRoot (target, name) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
class HTMLElementPlus extends HTMLElement { | |
static defaultAttributeValue() { | |
/* the name of the attribute is parsed in as a parameter */ | |
return; | |
} | |
static parseAttributeValue(name, value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tput smcup | |
# Turn user input off | |
stty -echo | |
display() { | |
BUFFER=$( | |
tput clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this line to the crontab to cache the agenda every 10 minutes | |
*/10 * * * * OUT=$(/usr/bin/gcalcli --tsv --nostarted agenda "`date`") && echo "$OUT" > $HOME/.gcalcli-agenda-cache | |
This is part of my tmux config to include it: | |
tmux_conf_theme_status_left=' #($HOME/bin/next_agenda.sh) | #{prefix}#{pairing}#{synchronized}' | |
tmux_conf_theme_status_right='#{?battery_status, #{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} | #{username}#{root} | #{hostname} |' | |
set -g status-interval 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR="$HOME/bin" | |
cd /tmp | |
curl -s https://api.github.com/repos/cdr/code-server/releases/latest \ | |
| grep "browser_download_url.\+linux-x86_64.tar.gz" \ | |
| cut -d : -f 2,3 \ | |
| tr -d \" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const skygeometry = new SphereGeometry( 25, 50, 50 , 0, 2 * Math.PI); | |
const skymaterial = new MeshBasicMaterial(); | |
skymaterial.side = BackSide; | |
skymaterial.onBeforeCompile = function (shader) { | |
shader.vertexShader = shader.vertexShader.replace('#include <common>', '#include <common>\n#define USE_UV'); | |
shader.fragmentShader = shader.fragmentShader.replace('#include <common>', '#include <common>\n#define USE_UV'); | |
shader.vertexShader = shader.vertexShader.replace('#include <uv_vertex>', ` | |
vUv = ( uvTransform * vec3( uv, 1 ) ).xy; | |
`) | |
shader.fragmentShader = shader.fragmentShader.replace('#include <map_fragment>', ` |
OlderNewer