Skip to content

Instantly share code, notes, and snippets.

View czottmann's full-sized avatar
💭
Sure.

Carlo Zottmann czottmann

💭
Sure.
View GitHub Profile
@czottmann
czottmann / Bundle+TestFlight.swift
Created October 11, 2023 18:29 — forked from lukaskubanek/Bundle+TestFlight.swift
A code snippet for detecting the TestFlight environment for a macOS app at runtime
import Foundation
import Security
extension Bundle {
/// Returns whether the bundle was signed for TestFlight beta distribution by checking
/// the existence of a specific extension (marker OID) on the code signing certificate.
///
/// This routine is inspired by the source code from ProcInfo, the underlying library
/// of the WhatsYourSign code signature checking tool developed by Objective-See. Initially,
#!/bin/sh
set -euo pipefail
# Set the paths to your Old/New Xcodes
OLD_XCODE="/Applications/Xcode-14.3.1.app"
NEW_XCODE="/Applications/Xcode-15.0.0.app" # To get build number
# Get New Xcode build number
OLD_XCODE_BUILD=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" ${OLD_XCODE}/Contents/Info.plist)
@czottmann
czottmann / fake-scan-automator.sh
Created September 14, 2022 21:07 — forked from Pezmc/fake-scan-automator.sh
Make a pdf look scanned with macOS automator as a quick action
#!/bin/bash
# This script takes a PDF or list of PDFs and outputs a file(s)
# named <file>_scanned.pdf that looks like it has been scanned
#
# Requires imagemagic and popper to be installed (brew install imagemagick poppler)
#
# Accepts: a list of files
# Usage: ./<scriptfilename> pdf1.pdf pdf2.pdf
#
# To use as a macOS automator quick action you need to:
@czottmann
czottmann / scompler-css-guide.md
Last active January 14, 2016 12:37 — forked from bobbygrace/trello-css-guide.md
Scompler CSS Guide

Scompler CSS Guide

"I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it's pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind."

You often hear updog saying stuff like this. Who's updog? Not much, who is up with you?

This is where any fun you might have been having ends. Now it's time to get serious and talk about rules.

Writing CSS is hard. Even if you know all the intricacies of position and float and overflow and z-index, it's easy to end up with spaghetti code where you need inline styles, !important rules, unused cruft, and general confusion. This guide provides some architecture for writing CSS so it stays clean an

@czottmann
czottmann / raspberry-pi-vpn-router.md
Created November 18, 2015 12:26 — forked from superjamie/raspberry-pi-vpn-router.md
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2015-09-24-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
require 'json'
require 'faraday'
# things you must configure
PATH_TO_DROPBOX = "/Users/your_name/Dropbox/backup/tweets/" # you need to create this folder
TWITTER_USER = "your_twitter_username"
@czottmann
czottmann / whatever-manifesto.md
Created April 24, 2012 12:52 — forked from hmans/whatever-manifesto.md
The Dick Manifesto

THE DICK MANIFESTO

  1. Don't be a dick.
// ossum radio buttons!
$('label:has(input:checked)').addClass('checked');
$('.input.radio label').click(function () {
$(this).siblings('label').removeClass('checked');
$(this).addClass('checked');
});
// besser:
$("form input:radio")

backup from google cache, still useful for svn repos with funny structure that git svn can't understand automatically

First, clone the SVN repo with:

git-svn clone svn+ssh://your-server/home/svn/project-name/trunk -r NNNN project-name.git

where NNNN is some relatively recent revision, unless you like waiting forever for git-svn to sync. Make sure that the revision number you pick is actually on trunk -- don't just choose an arbitrary number in the past. Don't bother trying to pull branches with the -b argument at this point -- if that worked, we