Skip to content

Instantly share code, notes, and snippets.

View baquaz's full-sized avatar

baquazan baquaz

View GitHub Profile
@baquaz
baquaz / CGEventSupervisor.swift
Created January 10, 2025 21:28 — forked from stephancasas/CGEventSupervisor.swift
A service class for monitoring global keyboard events in macOS Swift applications.
//
// CGEventSupervisor.swift
// Mouseless Messenger Pro
//
// Created by Stephan Casas on 4/24/23.
//
import Cocoa;
class CGEventSupervisor {
//
// ScrollIntoSheet.swift
// (c) Théo Arrouye 2024
//
//
import SwiftUI
struct ScrollIntoSheetView: View {
let backgroundColor: Color = .black
@baquaz
baquaz / mac-setup-init.sh
Last active October 12, 2024 18:15
Mac new machine setup
#!/bin/bash
# Setup script for setting up a new macos machine
echo "Starting setup"
# install xcode CLI
xcode-select —-install
# Check for Homebrew to be present, install if it's missing
if test ! $(which brew); then
@baquaz
baquaz / dotfiles-install.sh
Last active June 18, 2024 19:38
Automatic script to install dotfiles bare repo and back up all pre-existing files into '.config-backup' folder
#!/bin/bash
# Create the backup directory if it does not exist
mkdir -p $HOME/.config-backup
# Check if $HOME/.config exists
if [ -d "$HOME/.config" ]; then
if [ -L "$HOME/.config" ]; then
# It is a symlink!
echo "found a symlink: $HOME/.config"
@baquaz
baquaz / CellAttributesShowcaseListViewController.md
Created May 17, 2023 08:18 — forked from AngrenWen/CellAttributesShowcaseListViewController.md
Presentation of predefined UICollectionView cells (iOS 14)
@baquaz
baquaz / provisioning2xml.sh
Last active August 27, 2019 05:28
Looking into provisioniong profile (.mobileprovision)
#!/bin/bash
# Usage: provide 2 parameters(provisioning profile path and new filename)
#
# sh ./provisioning2xml.sh path xml_name
path=$1
name=$2
echo "Generating $name.xml from path: $path"
security cms -D -i "$path" >> ./"$name".xml
echo "Finished"
@baquaz
baquaz / gist:8f139077fc473ce47017381608d3b0f7
Created August 22, 2019 10:52 — forked from danielbraun/gist:27e43b914c6a2e081792
Vim syntax coloring for Cocoapods' Podfile.
// Append this to your .vimrc
au BufNewFile,BufRead Podfile set filetype=ruby
@baquaz
baquaz / RemovingByIndex.swift
Last active June 6, 2018 06:17
Another way to remove item from collection
guard let index = items.index(where: {$0 == item})
else {
return
}
items.remove(at: index)
@baquaz
baquaz / ArrayStorage.swift
Last active April 18, 2018 14:46
A class that saves and retrieves an array to the device
//: Playground - a class that saves and retrieves an array to the device
import Foundation
class ArrayStorageManager: NSObject {
static let shared = ArrayStorageManager()
private var documentsDirectoryURL: URL {
let url = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first
return url!
@baquaz
baquaz / GIF-Screencast-OSX.md
Created April 5, 2018 13:47 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: