Skip to content

Instantly share code, notes, and snippets.

View yene's full-sized avatar
🏅
Best Developer of the Day

Yannick yene

🏅
Best Developer of the Day
View GitHub Profile
@yene
yene / yt-dlp.conf
Created May 12, 2023 18:05
yt-dlp.conf
# do not stop on errors
--ignore-errors
# Write metadata to the video file
#--add-metadata
# skip modified time, use the current datetime for modification time
--no-mtime
# prefer mp4, and we don't need 4k
@yene
yene / generate-xcode-icons.sh
Created October 9, 2019 18:25
Generating icons for Xcode
#!/bin/bash
# pass in the file name of the source as first parameter
mkdir -p generated
rm generated/*
# remove alpha with a simple trick
sips -s format bmp "$1" --out tmp.bmp
sips -s format png tmp.bmp --out "$1"
@yene
yene / convert-webp.sh
Created October 9, 2019 17:18
Automator convert images to webp, keep mod and creation date
# automator Passes images in as argument
for f in "$@"
do
dc="$(GetFileInfo -d "$f")" # store creation date
dm="$(GetFileInfo -m "$f")" # store modification date
noExt=${f%.*}
# needs to be installed with brew install webp
newExt="$noExt".webp
/usr/local/bin/cwebp -q 90 "$f" -o "$newExt"
SetFile -d "$dc" "$newExt" # restore creation date
@yene
yene / grabbug.go
Created April 27, 2019 15:40
grab bug
package main
import (
"log"
"github.com/cavaliercoder/grab"
)
func main() {
client := grab.NewClient()
@yene
yene / macOS-naming.js
Created November 23, 2018 16:06
Quick and dirty functions to replicate macOS behaviour if filename is already taken.
var folderName = 'untitledfolder';
var nameTests = [
{
nr: 1,
fileSystemIn: [],
fileSystemOut: ['untitledfolder'],
},
@yene
yene / coffeemachinehomekit.md
Last active November 23, 2018 16:07
Coffee Machine as HomeKit Example, with how it can be rendered in Vue.js

A thought experiment to map a coffee machine to Apple HomeKits format.

{
  "name": "Machine A",
  "serialNumber": "A343-GXOERK",
  "model": "frank-17273-rev23",
  "modelFriendly": "Coffeemaker A232",
  "customerID": 1337,
 "characteristics": [
@yene
yene / laundy-sensor.ino
Created October 20, 2016 13:36
laundy-sensor.ino
// MPU6050 Includes
#include "Wire.h"
#include "I2Cdev.h"
#include "MPU6050.h"
// ESP8266 Includes
#include <ESP8266WiFi.h>
// DEFINE NODEMCU PINS
#define D0 16
@yene
yene / build.sh
Created August 7, 2016 19:11
Build and release
#!/bin/sh
APIKEY=$(<apikey.txt)
VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "Info.plist")
PREV_TAG=$(curl -s https://api.github.com/repos/yene/DisplayBrightness/releases/latest | python -c "import json,sys;obj=json.load(sys.stdin);print obj['tag_name'];")
if [ "$PREV_TAG" == "v$VERSION" ]; then
echo "Error: This version is already published!"
exit 1
fi
git push origin master
mkdir build
@yene
yene / style.css
Last active August 1, 2016 18:34
CSS template
* {
box-sizing: border-box;
}
html, body {
margin: 0;
padding: 0;
height: 100vw;
width: 100vw;
}
@yene
yene / cleanup.sh
Last active September 1, 2016 13:38
cleanup.sh
brew cleanup
rm -r ~/Library/Application\ Support/HandBrake/EncodeLogs/
rm -r ~/Library/Application\ Support/Spotify/PersistentCache/Update/
rm -r ~/Library/Application\ Support/uTorrent/
rm -r ~/Library/Application\ Support/com.evernote.EvernoteHelper/logs
find ~/Library/Application\ Support/Skype -name "media_messaging" -type d -exec rm -r "{}" \;
rm -r ~/Library/Application\ Support/1Password/Backups
rm -r ~/Library/Application\ Support/Sublime\ Text\ 3/Backup