Skip to content

Instantly share code, notes, and snippets.

View dannyow's full-sized avatar
👁️‍🗨️

Daniel dannyow

👁️‍🗨️
  • Warsaw
View GitHub Profile
@dannyow
dannyow / yt-playlist-chapters.sh
Last active July 23, 2024 23:36
Extract chapters from YT playlist with yt-dlp and jq
# Extract chapters from YT playlist
# Each chapter will be printed out as a valid markdown link to the chapter, with its title
yt-dlp --dump-json https://www.youtube.com/playlist\?list\=$PLAYLIST_ID | jq --raw-output '.id as $id | .chapters[] | "[\(.title)](https://youtu.be/watch?v=\($id)&t=\(.start_time))"'
@dannyow
dannyow / NSApp+AppIconOverlay.swift
Created January 12, 2023 16:31
Add overlay to the macOS app in runtime
//
// NSApp+AppIconOverlay.swift
//
// Created by Daniel on 12/01/2023.
//
import AppKit
extension NSApplication {
/// Checks if the app is launched from Xcode with attached debugger.
@dannyow
dannyow / Logger.swift
Last active August 27, 2022 13:07
Logger using os.log
//
// Logger.swift
//
// Created by Daniel Owsiański on 10/07/2022.
//
import Foundation
import os.log
///
@dannyow
dannyow / README.md
Created June 26, 2022 10:36 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.
@dannyow
dannyow / MetalViewController.swift
Created June 7, 2022 20:08
Hello World in Metal (as a self-contained NSViewController)
import Cocoa
import MetalKit
// Self-contained MetalViewController based on https://metalbyexample.com/modern-metal-1/
class MetalViewController: NSViewController {
var mtkView: MTKView!
var device: MTLDevice!
var commandQueue: MTLCommandQueue!
@dannyow
dannyow / hello-world.c
Last active November 14, 2021 00:27
How to print a non-latin text with raylib
#include <raylib.h>
int main(void) {
const int screenWidth = 800;
const int screenHeight = 450;
SetConfigFlags(FLAG_VSYNC_HINT);
SetConfigFlags(FLAG_WINDOW_RESIZABLE);
SetConfigFlags(FLAG_WINDOW_HIGHDPI);
@dannyow
dannyow / debug-breakpoint.scss
Created May 8, 2021 16:37
Show current Bootstrap breakpoint as overlay on top of the page
/*
Add this to the page:
<divid="breakpoint-debug"><spanclass="xs">xs</span><spanclass="sm">sm</span><spanclass="md">md</span><spanclass="lg">lg</span><spanclass="xl">xl</span><spanclass="xxl">xxl</span></div>
Sizes: https://getbootstrap.com/docs/5.0/layout/breakpoints/
*/
#breakpoint-debug {
// display:none;
position: absolute;
width: 100vw;
@dannyow
dannyow / post-checkout
Created January 15, 2021 20:39
post-checkout
#!/bin/sh
# Fix on Xcode problem with git-lfs
# Simply skip the git-lfs check if there is GIT_EXEC_PATH /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core
if [ -z "$GIT_EXEC_PATH" ]
then
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-checkout.\n"; exit 2; }
git lfs post-checkout "$@"
else
@dannyow
dannyow / avconvert-all.sh
Created December 16, 2020 12:37
Convert input video to all formats avail in avconvert
#!/usr/bin/env bash
# set -x
convert(){
avconvert --source $1 --output ${1/\.mp4/-$2.m4v} --preset $2
}
presets=(
"Preset640x480"
"Preset960x540"
@dannyow
dannyow / .block
Created June 5, 2017 08:44
Bubble Chart
license: gpl-3.0
height: 960
border: no