Skip to content

Instantly share code, notes, and snippets.

View henrycunh's full-sized avatar
😮‍💨

henrycunh henrycunh

😮‍💨
View GitHub Profile
@henrycunh
henrycunh / ytclip.sh
Created January 24, 2025 13:28
Download YT Clip
#!/usr/bin/env bash
#
# ytclip: Download and clip a portion of a YouTube video into MP4.
#
# Usage:
# ytclip <YOUTUBE_URL> --from <TIME> --to <TIME>
#
# <TIME> can be:
# - S (e.g. "75")
# - M:S (e.g. "2:38")
@henrycunh
henrycunh / o1-pro.html
Created January 23, 2025 23:22
ball thingy
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Rotating 4D Tesseract with Bouncing Ball</title>
<style>
html, body {
margin: 0;
padding: 0;
overflow: hidden;
@henrycunh
henrycunh / twitter-boost.js
Created December 1, 2022 19:38
blue checkmarks are hella boring
let header = null
function getHeader () {
if (header !== null) {
createButton()
return
} else {
header = document.querySelector('header')
setTimeout(getHeader, 100)
}
@henrycunh
henrycunh / serial-number.sh
Created March 8, 2022 21:25
Get the serial number of a Mac from terminal
system_profiler SPHardwareDataType | grep Serial | cut -d':' -f2 | sed 's/ //g'
@henrycunh
henrycunh / release.mjs
Created February 10, 2022 13:41
releasing a new version with zx + fsxx
import { $, argv, chalk } from 'zx'
import { io, read } from 'fsxx'
$.verbose = false
io.json.spaces = 4
const lastTag = `${await $`git tag | sort -V | tail -n 1`}`.trim()
const { _: [, type] } = argv
if (type === undefined) {
@henrycunh
henrycunh / delete-cloudflare-access-applications.sh
Last active December 29, 2021 16:07
Deleting Cloudflare Access applications
#!/bin/bash
# get list of applications from arguments
APPLICATIONS=$@
# if no applications are specified, throw error
if [ -z "$APPLICATIONS" ]; then
echo "[error] No applications specified."
exit 1
fi
@henrycunh
henrycunh / _responsive.scss
Created October 21, 2021 14:01
Responsiveness SASS mixins
@mixin support($size) {
@if $size == phone {
@media (max-width: 599px) { @content; }
} @else if $size == tablet-portrait {
@media (min-width: 600px) { @content; }
} @else if $size == tablet-landscape {
@media (min-width: 900px) { @content; }
} @else if $size == desktop {
@media (min-width: 1200px) { @content; }
} @else if $size == big-desktop {
@henrycunh
henrycunh / settings.json
Created January 28, 2021 14:41
Windows Terminal Configuration
// This file was initially generated by Windows Terminal 1.0.1811.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@henrycunh
henrycunh / amongraph.py
Last active October 23, 2020 22:01
te amo fessô diego
import sys
class Graph():
def __init__(self, vertices):
self.vertices = vertices
self.graph = [[0 for column in range(vertices)]
for row in range(vertices)]
def list_distances(self, dist):
for node in range(self.vertices):
@henrycunh
henrycunh / README.md
Last active December 15, 2019 16:17
Useful Docker Functions