Skip to content

Instantly share code, notes, and snippets.

View rendfall's full-sized avatar
💭
Coffee is a drink, not a language! ☕️

rendfall rendfall

💭
Coffee is a drink, not a language! ☕️
View GitHub Profile
@rendfall
rendfall / 1.js
Created January 27, 2019 14:35 — forked from chrisbuttery/1.js
Fade in / Fade out
// fade out
function fade(el) {
var op = 1;
var timer = setInterval(function () {
if (op <= 0.1){
clearInterval(timer);
el.style.display = 'none';
}
el.style.opacity = op;
@rendfall
rendfall / convert-mp4-to-mp3.bat
Created April 8, 2019 22:08
Batch script to convert mp4 files to mp3
echo off
for %%a in ("./source/*.mp4") do ffmpeg -i "%%a" -b:a 320K -vn "./output/%%a.mp3"
pause
@rendfall
rendfall / make-request-while-example.ts
Last active August 9, 2019 17:42
[RxJS] Retry HTTP request as long as response status is PENDING (1)
import { makeRequestWhile } from './make-request-while'
const MOCKED_API = {
PENDING: 'https://www.mocky.io/v2/5d4db060330000254b33796a',
SUCCESS: 'https://www.mocky.io/v2/5d4db057330000d43f337969',
ERROR: 'https://www.mocky.io/v2/5d4db0463300004b44337968',
}
const STATUSES = {
PENDING: 1,
@rendfall
rendfall / phaser-keypress-handler.js
Last active January 2, 2020 17:17
Phaser - handle keypress input event
// Phaser.Scene context
const keys = new Set();
this.input.keyboard.on('keydown', (event) => {
if (keys.has(event.code)) {
return
}
keys.add(event.code);
@rendfall
rendfall / grep-repo.sh
Created April 14, 2021 10:05
Grep repository through all revisions
git rev-list --all | (
while read revision; do
git grep -F 'phrase' $revision
done
)