View demo.js
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
/** | |
* @typedef {import("./typings").Car} Car | |
*/ | |
/** | |
* @type {Car} | |
*/ | |
const porsche993 = {}; |
View docker
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# Delete all containersdocker | |
rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q)# Prune unused volumesdocker volume prune |
View ffmpeg-compression
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
# https://unix.stackexchange.com/a/38380 | |
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4 |
View lint.css
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
/* forbidden nesting */ | |
:not(figure) > figcaption, | |
:not(fieldset) > legend, | |
:not(dl) > :is(dt, dd), | |
:not(tr) > :is(td, th), | |
:not(select) > :is(option, optgroup), | |
:not(table) > :is(thead, tfoot, tbody, tr, colgroup, caption) { | |
outline: 2px dotted red; | |
} |
View lambda.py
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
import json | |
from botocore.vendored import requests | |
import os | |
def lambda_handler(event, context): | |
payload = json.loads(event['body'], encoding='utf8') | |
title = payload["pullrequest"]["title"] | |
description = payload['pullrequest']['description'] | |
with open('checklist.txt') as f: | |
extra_text = f.read() |
View 1-easy.js
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
// Create a Promise that resolves after ms time | |
var timer = function(ms) { | |
return new Promise(resolve => { | |
setTimeout(resolve, ms); | |
}); | |
}; | |
// Repeatedly generate a number starting | |
// from 0 after a random amount of time | |
var source = async function*() { |
View netlify.toml
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
# Settings in the [build] context are global and are applied to all contexts | |
# unless otherwise overridden by more specific contexts. | |
[build] | |
# Directory to change to before starting a build. | |
# This is where we will look for package.json/.nvmrc/etc. | |
base = "project/" | |
# Directory (relative to root of your repo) that contains the deploy-ready | |
# HTML files and assets generated by the build. If a base directory has | |
# been specified, include it in the publish directory path. |
View save-file-local.js
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
/* | |
* Save a text file locally with a filename by triggering a download | |
*/ | |
var text = "hello world", | |
blob = new Blob([text], { type: 'text/plain' }), | |
anchor = document.createElement('a'); | |
anchor.download = "hello.txt"; | |
anchor.href = (window.webkitURL || window.URL).createObjectURL(blob); |
View shell.sh
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
sudo docker-compose run --rm -u root web chown -R mastodon:mastodon public/assets public/packs public/system |
NewerOlder