Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Working on Coil

Dacio dacioromero

💻
Working on Coil
View GitHub Profile
View App.svelte
<script lang="typescript">
import { writable } from 'svelte/store'
const store = writable(localStorage.getItem('key') ?? '')
store.subscribe(value => localStorage.setItem('key', value))
</script>
<input bind:value={$store} />
@dacioromero
dacioromero / gopro.py
Created Mar 25, 2021
Script to stitch together GoPro recordings with FFmpeg
View gopro.py
import glob
from collections import defaultdict
import subprocess
from os import path
def main(dest = ''):
recordings = defaultdict(list)
for file in glob.glob(f'GH{"[0-9]" * 6}.MP4'):
chapter = file[2:4]
View fi-jquery.user.js
// ==UserScript==
// @name Fuck It! jQuery
// @namespace https://gist.github.com/dacioromero/2646ac7e1d0bfd0ec88fb47b3d1e577a
// @description jQuery injector for your jQuery addiction
// @author Dacio Romero <me@dacio.dev>
// @homepageURL https://gist.github.com/dacioromero/2646ac7e1d0bfd0ec88fb47b3d1e577a
// @run-at document-idle
// @match *://*/*
// @grant none
// @version 1.0.0
@dacioromero
dacioromero / crontab
Last active May 22, 2020
Update qBittorrent trackers from https://github.com/ngosang/trackerslist daily
View crontab
@daily /usr/local/bin/python3 /root/update-trackers.py
View docker-compose.yml
version: "3"
services:
vpn:
image: "dperson/openvpn-client"
network_mode: "bridge"
cap_add:
- "NET_ADMIN"
devices:
- "/dev/net/tun"
environment:
View remove-transitive.js
const fs = require('fs')
const lockfile = require('@yarnpkg/lockfile')
const package = require('./package.json')
const lock = lockfile.parse(fs.readFileSync('yarn.lock', 'utf-8')).object
const allDeps = new Set()
const parseDep = ([name, version]) => {
allDeps.add(`${name}@${version}`)
View eslint.json5
{
// Possible Errors
"for-direction": "off",
"getter-return": "off",
"no-async-promise-executor": "off",
"no-await-in-loop": "off",
"no-compare-neg-zero": "off",
"no-cond-assign": "off",
"no-console": "off",
"no-constant-condition": "off",
@dacioromero
dacioromero / in-memory-storage.ts
Last active Jan 29, 2020
TypeScript Storage Implementation
View in-memory-storage.ts
class InMemoryStorage implements Storage {
private data = new Map<string, string>()
clear (): void {
this.data.clear()
}
getItem (key: string): string | null {
return this.data.get(String(key)) ?? null
}
View PickOmitByValue.ts
type KeysMatchingValue<T, V> = { [P in keyof T]: T[P] extends V ? P : never }[keyof T]
type PickByValue<T, V> = Pick<T, KeysMatchingValue<T, V>>
type OmitByValue<T, V> = Omit<T, KeysMatchingValue<T, V>>
View reddit_post_dry.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Post",
"description": "A Reddit post and its comments",
"type": "object",
"definitions": {
"votes": {
"type": "object",
"properties": {
"up": {