Skip to content

Instantly share code, notes, and snippets.

@orkoden
orkoden / karabiner.json.microsoftsculpt
Created February 9, 2017 13:33
Karabiner elements configuration file for using a Microsoft Sculpt Ergonomic Desktop keyboard with ISO-UK layout on macOS with US layout.
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true
},
"profiles": [
{
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
@orkoden
orkoden / How to create a new SSH key on macOS.md
Created June 21, 2023 04:17
How to create a new SSH key for git/ssh authentication and add it to the macOS keychain

How to create a new SSH key

for git/ssh authentication and add it to the macOS keychain

You want connect to server.com via SSH using key authentication? Follow this guide.

Generate new key pair

cd ~/.ssh
ssh-keygen -t ed25519 -C your@email.com
@orkoden
orkoden / tddberlin_iOS_notes.md
Last active May 18, 2021 08:43
Notes from TDD iOS Notes

TDD Workshop Notes

http://tdd-workshop.uikonf.com

Twitter hashtag #tddberlin

Mobile Central Europe Conference in Warsaw in Feb 2015

Resources

Reading

@orkoden
orkoden / hide or show desktop icons.applescript
Last active August 29, 2020 16:54
AppleScript to hide your messy desktop icons during presentations for Mac OS X.
display dialog "Desktop icons visible or hidden?" buttons {"Visible", "Hidden"} with icon 2 with title "Switch to presentation mode" default button 1
set switch to button returned of result
if switch is "Hidden" then
do shell script "defaults write com.apple.finder CreateDesktop -bool FALSE;killall Finder"
else
do shell script "defaults delete com.apple.finder CreateDesktop;killall Finder"
end if
@orkoden
orkoden / HackerrankObjectiveCBoilerplate.m
Last active July 26, 2020 01:50
Hackerrank.com Boilerplate template for reading from STDIN and writing to STDOUT for Objective-C
#import <Foundation/Foundation.h>
@interface HRSTDIOReadWriter : NSObject
@end
@implementation HRSTDIOReadWriter
+(NSString*) readFromSTDIN
{
NSFileHandle *kbd = [NSFileHandle fileHandleWithStandardInput];
@orkoden
orkoden / Measuring_average_performance.swift
Created May 12, 2020 18:19
Measuring performance of three different algorithms for calculating the average for an array of doubles
import Foundation
extension Array where Element: FloatingPoint {
func average() -> Element {
// one addition and one division per array item
return reduce(0) { result, value in result + value / Element(count) }
}
@orkoden
orkoden / Getting Started With Transitioning to Working Remotely.md
Created March 13, 2020 16:24
Getting Started With Transitioning to Working Remotely
@orkoden
orkoden / karabiner.json.magicforce68
Created February 9, 2017 13:31
Karabiner elements configuration file for using a MagicForce68 keyboard on macOS
{
"profiles": [
{
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 1957,
@orkoden
orkoden / fishytitles.m
Last active April 23, 2019 22:28
Swizzle all UIViewController titles to fish emoji 🐠
IMP titleImp = imp_implementationWithBlock(^NSString *(__unsafe_unretained id foo){
return @"🐠";
});
SEL titleSelector = NSSelectorFromString(@"title");
Method existingTitle = class_getInstanceMethod([UIViewController class],
titleSelector);
method_setImplementation(existingTitle,
titleImp);
@orkoden
orkoden / demotask.swift
Last active April 23, 2019 22:27
swift solution to codility demo task
// MissingInteger
// Find the smallest positive integer that does not occur in a given sequence.
//This is a demo task.
//
//Write a function:
//
//public func solution(_ A : inout [Int]) -> Int
//
//that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A.