Skip to content

Instantly share code, notes, and snippets.

View dezinezync's full-sized avatar
🏠
Working from home

Nikhil Nigade dezinezync

🏠
Working from home
View GitHub Profile
@dezinezync
dezinezync / fastfile.rb
Created August 20, 2021 02:46
Build a macOS App and notarize it using Fastlane
default_platform(:mac)
platform :mac do
before_all do
# Make sure we start off with a clean slate
ensure_git_status_clean
end
desc "Create a notarized build of the macOS App"
lane :notarized do
@dezinezync
dezinezync / Widgets.swift
Created September 25, 2024 03:42
AppIntentTimelineProvider bug on macOS 15.0
//
// Widgets.swift
// Widgets
//
// Created by Nikhil Nigade on 25/09/24.
//
import WidgetKit
import SwiftUI
import AppIntents
@dezinezync
dezinezync / SomeWC.swift.md
Created September 18, 2024 05:38
Cocoa App Swift #Previews

Consider this absolutely simple looking NSWindowController + NSViewController pair:

@objc final class MyFabWC: NSWindowController {
  @objc static let shared = MyFabWC(window: NSWindow(contentViewController: MyFabVC()))
  
  override func windowDidLoad() {
    super.windowDidLoad()
    
    // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
@dezinezync
dezinezync / sync.swift
Created April 12, 2024 06:47
Sync Operation Example
final class SyncOperation: OperationSuperclass {
public override func run() {
print("Sync has started")
Task { [weak self] in
guard let self else {
return
}
do {
@dezinezync
dezinezync / holidays2024.ics
Last active March 16, 2024 15:39
Holidays(2024) ICS - Fixed. Derived from: https://www.india.gov.in/calendar/2024/export.ics
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Date iCal//NONSGML kigkonsult.se iCalcreator 2.20.2//
METHOD:PUBLISH
X-WR-CALNAME;VALUE=TEXT:Holiday Calendar
BEGIN:VTIMEZONE
TZID:Asia/Kolkata
BEGIN:STANDARD
DTSTART:19451015T000000
TZOFFSETFROM:+0630
@dezinezync
dezinezync / DZShadowsView.swift
Last active December 5, 2023 07:36
DZShadowsView
//
// DZShadowsView.swift
//
//
// Created by Nikhil Nigade on 16/12/21.
//
#if !os(watchOS)
#if os(iOS)
@dezinezync
dezinezync / vapor.fluent.mysql.md
Last active October 7, 2023 03:23
Vapor-Fluent with MySQL: incorrect character set used

Base Query

SELECT * FROM performance_schema.session_variables
WHERE VARIABLE_NAME IN (
 'character_set_client', 'character_set_connection',
 'character_set_results', 'collation_connection'
) ORDER BY VARIABLE_NAME;

Sequel Pro

@dezinezync
dezinezync / UISlider+MacCatalyst.h
Last active August 18, 2023 13:31
UISlider crashes the app when used in a Mac Catalyst app. Also applies to AVPlayerViewController. This category swizzles the methods with blank implementations.
//
// UISlider+MacCatalyst.m
// Elytra
//
// Created by Nikhil Nigade on 30/09/20.
//
/**
* USE AT YOUR OWN RISK!
* The only downside of using this category is that you end up with a slider with a comically larger tracking button.
@dezinezync
dezinezync / dribbble.less
Created June 22, 2023 13:57
Dribbble Dark Mode
@media (prefers-color-scheme: dark) {
body {
background: #101010;
}
.psst {
display: none;
overflow: hidden;
margin: -1;
}
@dezinezync
dezinezync / UIButton+Catalyst.swift
Last active November 8, 2021 05:56
UIButton additions for macCatalyst
//
// UIButton+Catalyst.swift
// Elytra
//
// Created by Nikhil Nigade on 09/07/21.
// Copyright © 2021 Dezine Zync Studios. All rights reserved.
//
import UIKit