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
<div style="position: relative;height: 245px;overflow: hidden;"> | |
<iframe | |
style="position: absolute;top:0;left: 0;width: 100%;height: 100%;" | |
src="https://io-radio-embed.orderandchaoscreative.com/" | |
frameborder="0" scrolling="no" | |
onload="this.height=this.contentWindow.document.body.scrollHeight;" | |
></iframe> | |
</div> |
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
r = 0xff; | |
g = 0xff; | |
b = 0xff; | |
rgb = (r << 16) | (g << 8) | b; | |
console.log(rgb); | |
red = (rgb >> 16) & 0x0ff; | |
green = (rgb >> 8) & 0x0ff; | |
blue = (rgb) & 0x0ff; | |
console.log(red); | |
console.log(green); |
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
function png2mp4() { | |
ffmpeg -framerate 12 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p "out${1}.mp4"; | |
mkdir "stills${1}"; | |
find ./ -maxdepth 1 -name '*.png' -exec mv {} "./stills${1}" \; | |
} |
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
# flatColourConvert image.png red | |
function flatColourConvert() { | |
magick convert "$1" -fill "$2" -colorize 100% x.png | |
} | |
# replaceColours "#1B3057" "#2B373D" | |
# replaceColours red "#2B373D" 70% | |
function replaceColours() { | |
magick convert *.png -set filename:original %t -channel RGB -fuzz ${3:-25%} -fill $1 -opaque $2 %[filename:original].png | |
} |
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
function chunkPublicKey(key) { | |
const start = '-----BEGIN PUBLIC KEY-----'; | |
const end = '-----END PUBLIC KEY-----'; | |
const result = []; | |
try { | |
const arr = key.split(''); | |
while(arr.length) { | |
result.push(arr.splice(0, 64).join('')); | |
} | |
} catch(e) { |
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
58C2C1 Blue | |
3282B0 Second Blue | |
40C675 Green | |
D58F21 Orange/Yellow | |
6388C5 Blue | |
A9539A Purple | |
BC3F3C Red | |
E5265F Pink | |
CF6436 Orange | |
AD9D8D White |
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 | |
brew unlink vim | |
brew install cmake macvim | |
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim; | |
touch .vimrc; | |
cat << EOF > .vimrc | |
set nocompatible |
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 combineObjectArrays = (p: any[], q: any[], key = 'id') => { | |
const storedIds: any = []; | |
const arr: any = []; | |
for (let i = 0; i < Math.max(p.length, q.length); i++) { | |
if (i < p.length && !storedIds.includes(p[i][key])) { | |
storedIds.push(p[i][key]); | |
arr.push(p[i]); | |
} | |
if (i < q.length && !storedIds.includes(q[i][key])) { | |
storedIds.push(q[i][key]); |
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 camelCaseToDelimitedString = (string, delimiter = '-') => | |
string.replace(/([a-z0-9]|(?<!^)(?=[A-Z]))([A-Z])/g, '$1'+delimiter+'$2').toLowerCase(); | |
const delimitedStringToCamelCase = (string, delimiter = '-') => | |
string.replace(new RegExp(delimiter + '([a-z])', 'g'), (m, c) => c.toUpperCase()); |
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
ffmpeg -f x11grab -y -r 30 -s 1920x1080 -i :0.0 -vcodec huffyuv out.avi | |
# Then convert it to .mp4 | |
ffmpeg -y -i out.avi -s 1920x1080 -f mp4 -vcodec libx264 -preset slow -crf 18 -b:v 3000k -maxrate 4000k -bufsize 512k -c:a aac -b:a 128k -strict -2 out.mp4 | |
# and remove the .avi | |
rm out.avi |