Skip to content

Instantly share code, notes, and snippets.

View dobladov's full-sized avatar
📺
Streaming!

Daniel Doblado dobladov

📺
Streaming!
View GitHub Profile
@dobladov
dobladov / react.d.ts
Last active April 12, 2022 10:38
Explicit children React 18
/**
* React now requires the childen prop to be explicit in order to make clear which components take a children.
*
* > The most notable change is that the children prop now needs to be listed explicitly when defining props, for example:
* @see https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-typescript-definitions
*/
import React from 'react';
// eslint-disable-next-line
@dobladov
dobladov / TamperMonkey.js
Last active March 25, 2022 10:06
Uncheck all viewed checkboxes of a pull request on GitHub
// ==UserScript==
// @name Expand all
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Expands all boxes of a GitHub PR
// @author You
// @match https://github.com/zattoo/web/pull/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
// @run-at context-menu
@dobladov
dobladov / last.sh
Last active February 23, 2022 14:10
gh command get last PR id
gh pr list -s all --json number --jq ".|=sort_by(.number)|last|.number"
@dobladov
dobladov / reset.py
Created December 20, 2021 12:36
Reset Blender canvas
import bpy
objs = [ob for ob in bpy.context.scene.objects if ob.type in ('CAMERA', 'MESH')]
bpy.ops.object.delete({"selected_objects": objs})
# bpy.ops.mesh.primitive_cube_add(size=2, enter_editmode=False, align='WORLD', location=(4, 0, 0), scale=(1, 1, 1))
@dobladov
dobladov / main.js
Last active July 31, 2020 12:13
Get supported DRM widevine, playready, fairplay
const isKeySystemSupported = async (system) => {
const config = [{
initDataTypes: ['cenc'],
audioCapabilities: [{
contentType: 'audio/mp4;codecs="mp4a.40.2"',
}],
videoCapabilities: [{
contentType: 'video/mp4;codecs="avc1.4d4020"',
}],
}];
@dobladov
dobladov / walk.js
Created July 20, 2020 09:43
Get all files recursively on a directory
import path from 'path';
import fse from 'fs-extra';
/**
* List all files on a given directory recursively
* @param {string} directory
* @returns {Promise<string[]>}
*/
export const walk = async (directory) => {
const files = [];
@dobladov
dobladov / curl.sh
Created July 9, 2020 08:37
Force update cast device
# https://www.reddit.com/r/Chromecast/comments/6ddhz4/force_update_from_chromecast_on_windows/
curl -H "Content-Type: application/json" -d '{"params": "ota foreground"}' http://192.168.1.20:8008/setup/reboot -v
# https://github.com/LMMS/lmms/issues/4919#issuecomment-477667138
export QT_AUTO_SCREEN_SCALE_FACTOR=0
@dobladov
dobladov / flutter.md
Last active May 7, 2020 19:03
How to install flutter with Android Studio in Ubuntu 20.04
@dobladov
dobladov / screen.sh
Created April 23, 2020 06:26
Script for setting 4K resolutions
#!/bin/bash
# I want them big
xrandr --newmode "3840x2160" 297.00 3840 4016 4104 4400 2160 2168 2178 2250 +hsync +
xrandr --addmode HDMI-2 3840x2160
# I want them chunky
xrandr --newmode "M12" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
xrandr --addmode HDMI-2 M12