Skip to content

Instantly share code, notes, and snippets.

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

Johannes j0d5

🏠
Working from home
  • Hannover
View GitHub Profile
@sp00n
sp00n / mtb-news.de-darkmode.user.css
Last active September 15, 2023 05:32
mtb-news.de Dark Mode
/* ==UserStyle==
@name mtb-news.de Dark Mode
@description A dark mode for the mtb-news.de forums, to be used with an addon like Stylus
@namespace sp00n.mtb-news.de
@version 3.2.4
@author sp00n82
@homepageURL https://gist.github.com/sp00n/2fa640e641a3e729cdc8035a4da2412d
@supportURL https://www.mtb-news.de/forum/t/darkmode-fuer-das-neue-forum-css-code-fuer-stylus-addon.891774/
@license Creative Commons CC BY-SA 3.0 DE
==/UserStyle== */
let a: Double? = 1.0
let b: Double? = 2.0
let c: Double? = 3.0
let d: Double? = 4.0
let e: Double? = 5.0
let f: Double? = 6.0
let g: Double? = 7.0
extension Optional {
func `or`(_ value : Wrapped?) -> Optional {
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active July 17, 2024 12:55
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@steipete
steipete / ios-xcode-device-support.sh
Last active July 13, 2024 21:09
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@kharmabum
kharmabum / ocmock-cheatsheet.m
Last active October 8, 2022 07:55
OCMock cheatsheet
/*----------------------------------------------------*/
#pragma mark - XCTAsserts
/*----------------------------------------------------*/
XCTAssert(expression, format...);
XCTAssertTrue(expression, format...);
XCTAssertFalse(expression, format...);
XCTAssertEqual(expression1, expression2, format...);
XCTAssertNotEqual(expression1, expression2, format...);
XCTAssertNil(expression, format...);
@orta
orta / gist:6138581
Last active April 19, 2020 15:52
Objective-C Documentation discussion
TLDR
If you want the simplest option just start /** [content] */ slashes in your header files. Do it before the @implementation for class comments and above methods for method documentation.
Doing this is the minimal for support in LLVM and Appledoc, which means you get CocoaDocs & XCode support.
Not TLDR
Good examples:
https://github.com/marcransome/MRBrew/blob/master/MRBrew/MRBrew.h
https://github.com/AFNetworking/AFNetworking/blob/master/AFNetworking/AFHTTPClient.h
@jpawlowski
jpawlowski / brew-sync.sh
Last active September 26, 2023 19:54
Sync Homebrew installations between Macs via Dropbox
#!/bin/bash
# Sync Homebrew installations between Macs via Dropbox
#
BREW="/usr/local/bin/brew"
# first get local settings
echo "Reading local settings ..."
rm -f /tmp/brew-sync.*
@ganwell
ganwell / logspec.py
Created September 23, 2012 16:08
Pylab spectogram with log. frequency scale
import numpy
import scipy
import matplotlib.pyplot as pyplot
def decibel(lin):
"""Convert amplitude to decibel.
We might later need power to decibel..."""
return 20*numpy.log10(norm(lin))