Skip to content

Instantly share code, notes, and snippets.

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

Florian Krüger floriankrueger

🏠
Working from home
View GitHub Profile
@floriankrueger
floriankrueger / Reachability+NetworkType.swift
Created April 30, 2018 10:25
Getting the current network connection type through Reachability and CoreTelephony (based on https://stackoverflow.com/a/36451194/766873)
import Reachability
import CoreTelephony
enum NetworkType {
case unknown
case noConnection
case wifi
case wwan2g
case wwan3g
case wwan4g
@floriankrueger
floriankrueger / NSDate+Decodable.swift
Created April 5, 2016 07:11
Decoding NSDate using Himotoki before 2.0 (-beta)
import Foundation
import Himotoki
enum ISO8601DateError: ErrorType {
case WrongFormat(string: String)
}
private let iso8601DateFormatter = NSDate.createIso8601DateFormatter()
extension NSDate: Decodable {
@floriankrueger
floriankrueger / html-editors.md
Created November 12, 2021 13:09 — forked from manigandham/rich-text-html-editors.md
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@floriankrueger
floriankrueger / script.js
Last active December 14, 2020 15:18
Yael
// Yael.js
// Family
//
// Created by Galia & Arad
// on Nov 30th 2020
//
// Copyright © 2020 Family. All rights reserved
import { seroussi_daube as family } from './families'
import FamilyMember from './FamilyMember'
#!/usr/bin/env xcrun swift -F Carthage/Build/Mac
import Foundation
import Markingbird
protocol Streamable {
var title: String { get }
var body: String { get }
}
@floriankrueger
floriankrueger / XQCView.m
Last active December 29, 2015 11:59
Cocoa (Touch) templates for common subclasses
#import "XQCView.h"
@interface XQCView ()
@end
@implementation XQCView
#pragma mark - Memory Management
@floriankrueger
floriankrueger / presentation.yaml
Last active December 18, 2015 14:29
Just a presentation I did on unit testing in Xcode to wrap up the whole topic and provide a basis for our in-team discussion. It uses the SublimeScreencastDirector plugin by @colinta to be "played". (https://github.com/colinta/SublimeScreencastDirector) Unfortunately, it's in german. But the code examples are kind of international ;)
- clear: 0 # screen 00 : Titel
- set_syntax: 'Packages/Text/Plain text.tmLanguage'
- goto: [4, 14]
- write_lines:
- 'Unittesting für iOS & OS X'
- goto: [5, 14]
- delay: 500
- write_lines:
- '=========================='
- goto: [7, 14]
@floriankrueger
floriankrueger / generics_in_swift_2.swift
Last active October 30, 2015 16:00
specialized subclass of generic superclass
import Foundation
struct Something {}
class Base<T> {
let something: T
init(something: T) {
self.something = something
}
@floriankrueger
floriankrueger / findUnusedPngs.sh
Created May 23, 2012 13:27
finds and prints unreferenced png files from xcode projects
#!/bin/sh
PROJ=`find . -name '*.xib' -o -name '*.[mh]'`
for png in `find . -name '*.png'`
do
filename=`basename $png`
name=${filename%.*}
if ! grep -q $name $PROJ; then
echo "$png is not referenced"
fi
@floriankrueger
floriankrueger / buckets.spec.coffee
Created September 27, 2011 13:35
better db interaction tests with jasmine
mongodb = require 'mongodb'
Buckets = require '../../models/buckets'
describe 'buckets', () ->
# suite wide db object
db = null
# db setup
beforeEach ->