Skip to content

Instantly share code, notes, and snippets.

View AshKyd's full-sized avatar
🐳
a frood who really knows where his towel is

Ash Kyd AshKyd

🐳
a frood who really knows where his towel is
View GitHub Profile
@keyframes anim-rotate {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
body{
background: repeating-linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.2) 1px, transparent 2px, transparent 3px);
}
@AshKyd
AshKyd / react-ratio-box-copy-paste.jsx
Last active February 6, 2020 14:36
A copy-pasteable React ratio box compont. Make boxes with customizable ratios. Should be pretty fast.
import React, { useMemo } from 'react';
import PropTypes from 'prop-types';
const topLevelStyle = {
position: 'relative'
};
const innerStyle = {
position: 'absolute',
left: 0,
@AshKyd
AshKyd / ffmpeg.md
Last active December 1, 2019 20:30

Create a time lapse of some sort:

ffmpeg -i GH012287_1575218935438_high.MP4 -vf tmix=frames=5:weights="1 1 1 1 1",select='not(mod(n\,5))',setpts=0.5*PTS out.mp4

Optionally add deshake if it's jittery:

ffmpeg -i GH012287_1575218935438_high.MP4 -vf deshake,tmix=frames=10:weights="1",setpts=0.5*PTS out-4.mp4
@AshKyd
AshKyd / timelapse.md
Last active October 29, 2021 06:17 — forked from alexellis/timelapse.md
ffmpeg time-lapse

Convert sequence of JPEG images to MP4 video

Crop to 4k:

ffmpeg -r 30 -pattern_type glob -i '*.JPG' -s 3840:2160 -vcodec libx264 -pix_fmt yuv420p timelapse.mp4

Crop to original:

ffmpeg -r 30 -pattern_type glob -i '*.JPG' -vcodec libx264 -pix_fmt yuv420p timelapse.mp4

(function() {
const nets = {
twitter: ['https://twitter.com/*$'],
linkedin: ['https://www.linkedin.com/company/*$', 'linkedin.com/in/*$'],
instagram: ['https://www.instagram.com/*$'],
facebook: ['https://www.facebook.com/*$'],
glassdoor: ['https://www.glassdoor.com/Reviews/*.htm$'],
github: ['https://(www.)?github.com/*$']
}
@AshKyd
AshKyd / update-bash-macos.sh
Created June 15, 2019 15:56
Update MacOS bash & set default shell
brew install bash
sudo echo /usr/local/bin/bash >> /etc/shells
chsh -s /usr/local/bin/bash
@AshKyd
AshKyd / gifenc.sh
Created June 22, 2018 01:24
GIF encoding with ffmpeg
#!/bin/sh
palette="/tmp/palette.png"
#crop=320:240,500,300
# -ss 00:00:03 -t 00:00:08
#filters="crop=320:320:500:100,fps=16"
filters="fps=24,scale=600:-1:flags=lanczos"
#filters="fps=5"
#filters="fps=16"
@AshKyd
AshKyd / gist:8dfda35cd0d1c01559a8e85122201863
Created June 1, 2018 03:54
Messenger webview user agents
Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E302 [FBAN/MessengerForiOS;FBAV/167.0.0.57.96;FBBV/109575372;FBDV/iPhone7,1;FBMD/iPhone;FBSN/iOS;FBSV/11.3.1;FBSS/3;FBCR/Telstra;FBID/phone;FBLC/en_GB;FBOP/5;FBRV/0]
Mozilla/5.0 (Linux; Android 8.0.0; G3116 Build/48.1.A.0.129; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.158 Mobile Safari/537.36 [FB_IAB/Orca-Android;FBAV/167.0.0.28.94;]/FB_MEXT_IAB
(function() {
var ads = Array.from(document.querySelectorAll('path[d="M20.75 2H3.25A2.25 2.25 0 0 0 1 4.25v15.5A2.25 2.25 0 0 0 3.25 22h17.5A2.25 2.25 0 0 0 23 19.75V4.25A2.25 2.25 0 0 0 20.75 2zM17.5 13.504a.875.875 0 1 1-1.75-.001V9.967l-7.547 7.546a.875.875 0 0 1-1.238-1.238l7.547-7.547h-3.54a.876.876 0 0 1 .001-1.751h5.65c.483 0 .875.39.875.874v5.65z"]')).map(path => {
try {
return path.parentNode.parentNode.parentNode.parentNode.querySelector('path[d="M20.207 7.043a1 1 0 0 0-1.414 0L12 13.836 5.207 7.043a1 1 0 0 0-1.414 1.414l7.5 7.5a.996.996 0 0 0 1.414 0l7.5-7.5a1 1 0 0 0 0-1.414z"]').parentNode.parentNode.parentNode;
} catch (e) {
console.log('couldnt', path);
return null;
}
});