Skip to content

Instantly share code, notes, and snippets.

View JohannMG's full-sized avatar
🐺

Johann Garces JohannMG

🐺
View GitHub Profile
@JohannMG
JohannMG / Comp.naming
Created July 24, 2026 05:57
Picard Naming Script Specifically for Compilations with various years
$if2(%albumartist%,%artist%)/
$if(%album%,%album%/,Unkown Album/)
$if($gt(%totaldiscs%,1),%discnumber%-,)
$if(%tracknumber%,$num(%tracknumber%,2) - , )
$if(%_multiartist%,%artist% - ,$if2(%artist%,%albumartist%) - )
%title% ($if(%date%,$left(%date%,4)))
@JohannMG
JohannMG / Picard Naming Script 2 -
Created March 6, 2026 05:03
Picard Naming Script 2 - Artist over Album Artist better supports Label Compilations
$if2(%albumartist%,%artist%)/
$if(%date%, $left(%date%,4) - ,)
$if(%album%,%album%/,Unkown Album/)
$if($gt(%totaldiscs%,1),%discnumber%-,)
$if(%tracknumber%,$num(%tracknumber%,2) - , )
$if(%_multiartist%,%artist% - ,$if2(%artist%,%albumartist%) - )
%title%
@JohannMG
JohannMG / Naming Script
Last active March 6, 2026 05:00
Picard Naming Script
$if2(%albumartist%,%artist%)/
$if(%date%, $left(%date%,4) - ,)
$if(%album%,%album%/,Unkown Album/)
$if($gt(%totaldiscs%,1),%discnumber%-,)
$if(%tracknumber%,$num(%tracknumber%,2) - , )
$if(%_multiartist%,%artist% - ,$if2(%albumartist%,%artist%) - )
%title%
@JohannMG
JohannMG / HashableBisector.swift
Created April 21, 2022 23:23
Quick little bisector in swift for hashable items for the case when you're not bisecting a linear list.
//
// HashableBisector.swift
// TestHashableBisector
//
// Created by Johann Garces on 4/21/22.
//
import Foundation
enum BisectorState : Equatable {
@JohannMG
JohannMG / PasswordRequirementsView.swift
Created October 30, 2021 22:26
Made this view in UIKit before and remade in SwiftUI. Lets you create a set of parameters to show to the user to visually identify if they have a password that will pass requirements.
//
// PasswordRequirementsView.swift
// SwiftUiPlayground
//
// Created by Johann Garces on 10/30/21.
//
/*
* Made this view in UIKit before and remade in SwiftUI.
* Lets you create a set of parameters to show to the user to visually identify
@JohannMG
JohannMG / FirtDraggableLabel.swift
Created October 17, 2021 22:23
Quick test on adding subview to the window. We are making a label that when tapped creates a second dragging label. The dragging label is moveable around the screen. Then when you release the dragging view is removed and the label is updated.
/*
FirtDraggableLabel, October 2021
Quick test on adding subview to the window.
We are making a label that when tapped creates a second dragging label.
The dragging label is moveable around the screen.
Then when you release the dragging view is removed and the label is updated.
This project is also me remembering how UIKit UIWindows work.
As well as adding subviews directly to UIWindows.
@JohannMG
JohannMG / Quick_Selectors_Overview.txt
Created October 12, 2021 16:59
I taught a quick class on how objective C selectors work
objective-c selectors:
SEL
The alternative to blocks.
This is how delegate/protocol patterns work. (another talk)
Most common API is for UIButtons / UIControls
[button addTarget:self action:@selector(aMethod:) forControlEvents:UIControlEventTouchDown];
-(void)aMethod:(UIButton*)sender
Calls the selector on the target.
@JohannMG
JohannMG / Main.cpp
Created September 24, 2020 03:46
Confirm: Can use array with const char* to have a sub array of other const char* to fill a QMap
#include <QCoreApplication>
#include <QMap>
#include <QMapIterator>
#include <QDebug>
using StringIntMap = QMap<const char*, int>;
void addToMap(StringIntMap &map, const char* key, int value)
{
map[key] = value;
@JohannMG
JohannMG / main.cpp
Created September 24, 2020 03:40
Confirm: You can iterate through array of char pointers.
#include <QCoreApplication>
#include <QMap>
#include <QMapIterator>
#include <QDebug>
using StringIntMap = QMap<const char*, int>;
void addToMap(StringIntMap &map, const char* key, int value)
{
map[key] = value;
@JohannMG
JohannMG / main.cpp
Created September 24, 2020 03:36
Confirm: Passing QMap reference to helper function edits the same QMap.
#include <QCoreApplication>
#include <QMap>
#include <QMapIterator>
#include <QDebug>
using StringIntMap = QMap<const char*, int>;
void addToMap(StringIntMap &map, const char* key, int value)
{
map[key] = value;