Skip to content

Instantly share code, notes, and snippets.

View odonckers's full-sized avatar

Owen Donckers odonckers

View GitHub Profile
@odonckers
odonckers / tab-center-reborn.css
Last active February 2, 2023 14:48
My custom CSS for Tab Center Reborn on Firefox
/* Overwrite some colours */
:root {
--tab-separator: transparent;
--tab-selected-line: transparent;
--tablist-separator: #cccccc;
--overflow-indicator-border: #333333;
}
@media (prefers-color-scheme: dark) {
:root {
@odonckers
odonckers / 100_without_numbers_inline.py
Last active April 20, 2022 14:43
Print 0...100 without numbers on one line
[print(i) for i in range(int("".join([str(int(x)) for x in [True, False, True]])))]
@odonckers
odonckers / 100_without_numbers.py
Last active April 20, 2022 14:44
Print 0...100 without numbers
def bool_to_int(bool_list):
return int("".join([str(int(x)) for x in bool_list]))
if __name__ == "__main__":
for i in range(bool_to_int([True, False, True])):
print(i)
@odonckers
odonckers / MenuButton.swift
Last active February 17, 2022 15:30
Solution for iOS 14 Contextual Menu Button Missing in SwiftUI
//
// MenuButton.swift
// Check Register
//
// Created by Owen Donckers on 7/16/20.
// Copyright © 2020 Owen Donckers. All rights reserved.
//
import SwiftUI
@odonckers
odonckers / UINavigationBarWithSubtitle.swift
Last active February 20, 2017 17:46 — forked from nazywamsiepawel/UINavigationBarWithSubtitle.swift
UINavigationBar with subtitle / swift
func setTitle(title: String, titleColor: UIColor, titleSize: Int, subtitle: String, subtitleColor: UIColor, subtitleSize: Int) -> UIView {
let titleLabel = UILabel(frame: CGRect(x: 0, y: 0, width: -5, height: 0))
titleLabel.backgroundColor = UIColor.clear
titleLabel.textColor = titleColor
titleLabel.font = UIFont.boldSystemFont(ofSize: CGFloat(titleSize))
titleLabel.text = title
titleLabel.sizeToFit()
let subtitleLabel = UILabel(frame: CGRect(x: 0, y: 18, width: 0, height: 0))
@odonckers
odonckers / xcode_ramdisk.sh
Created July 8, 2016 21:07 — forked from derjohng/xcode_ramdisk.sh
Create a RAM disk for using with XCode, with Umount disks method
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"