Skip to content

Instantly share code, notes, and snippets.

Avatar
🦆
Working

Yannick Spreen yspreen

🦆
Working
View GitHub Profile
View ffmpeg.sh
ffmpeg -i input output
rm calculator*mp4 ; ls -1 calculator* | while read f; do ffmpeg -i "$f" -c:v hevc_videotoolbox -q:v 65 -tag:v hvc1 -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:-1:-1:color=black" -s 1920x1080 -r 60 -strict experimental -c:a aac -b:a 128k -ar 48000 -ac 2 "$f.mp4" </dev/null; done
-i my-video.mov -vcodec h264 -acodec mp2
-acodec libvo_aacenc -vcodec libx264 -s 1920x1080 -r 60 -strict experimental
View SwiftAttributedStrings.swift
//
// ContentView.swift
//
// Created by @spreen_co on 11/13/22.
//
import SwiftUI
struct ContentView: View {
var body: some View {
@yspreen
yspreen / create_doppler_service_token.sh
Created Jul 24, 2022 — forked from ryan-blunden/create_doppler_service_token.sh
Crate a Doppler Service Token from the Command Line
View create_doppler_service_token.sh
#!/usr/bin/env bash
# Requires a CLI token
DOPPLER_TOKEN="$(doppler configure get token --plain)" \
DOPPLER_PROJECT="$(doppler configure get project --plain)" \
DOPPLER_CONFIG="$(doppler configure get config --plain)" \
\
SERVICE_TOKEN=$(curl -sS --request POST \
--url https://api.doppler.com/v3/configs/config/tokens \
View .hyper.js
"use strict";
let cursorColor = "#10c2b3";
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
View extract-js-map.sh
#!/bin/sh
mapfile="$1"
seq 0 $((`jq -r '.sources | length' "$mapfile"`-1)) | while read n
do
file="$(jq -r ".sources[$n]" "$mapfile")"
dir="$(dirname "$file")"
mkdir -p "$dir"
jq -r ".sourcesContent[$n]" "$mapfile" > "$file"
View tmp.json
{
"title": "Asset Metadata",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Identifies the asset to which this NFT represents"
},
"description": {
"type": "string",
@yspreen
yspreen / reflect.py
Created Dec 16, 2021 — forked from huyng/reflect.py
A simple echo server to inspect http web requests
View reflect.py
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@yspreen
yspreen / adobe-fix.sh
Created Aug 4, 2021
Fix adobe xd install
View adobe-fix.sh
sudo rm -rf "~/Library/Application Support/Adobe"
sudo rm -rf "~/Library/Preferences/Adobe"
sudo rm -rf "~/Library/Logs/Adobe"
sudo rm -rf "~/Library/Caches/Adobe"
sudo rm -rf "/Library/Application Support/Adobe"
sudo rm -rf "/Library/Preferences/Adobe"
sudo rm -rf "/Library/Logs/Adobe"
sudo rm -rf "/Library/Caches/Adobe"
View URLDigest.swift
//
// URLDigest.swift
//
// Created by Yannick Spreen on 7/31/21.
//
import Foundation
import CommonCrypto
class URLDigest {
@yspreen
yspreen / Image+Trim.swift
Created Jul 14, 2021 — forked from chriszielinski/Image+Trim.swift
[Swift 5] NSImage/UIImage Crop/Trim Transparency
View Image+Trim.swift
// Image+Trim.swift
//
// Copyright © 2020 Christopher Zielinski.
// https://gist.github.com/chriszielinski/aec9a2f2ba54745dc715dd55f5718177
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is