Skip to content

Instantly share code, notes, and snippets.

View hslatman's full-sized avatar
💭
Gitting around

Herman Slatman hslatman

💭
Gitting around
View GitHub Profile
@hslatman
hslatman / create_app_store_connect_api_token.py
Last active February 25, 2019 12:19
Create App Store Connect API Token
from __future__ import print_function
import argparse
import os
import sys
import time
import jwt
def configure_with(args):
iss = args.iss
@hslatman
hslatman / UITableView+Registration.swift
Created December 20, 2018 07:59 — forked from grzegorzkrukowski/UITableView+Registration.swift
UITableView and UICollectionView extensions that allows to auto-register cells and extends both with simplified interfaces for dequeuing Edit
public protocol CellRegistration: class {
static var reuseIdentifier: String { get }
}
extension CellRegistration where Self: UIView {
public static var reuseIdentifier: String {
return String(describing: self)
}
}
@hslatman
hslatman / upload_to_simplemdm.rb
Created December 18, 2018 11:49 — forked from kcharwood/upload_to_simplemdm.rb
SimpleMDM Fastlane Action
require "SimpleMDM"
module Fastlane
module Actions
module SharedValues
end
class UploadToSimplemdmAction < Action
def self.run(params)
SimpleMDM.api_key = "#{params[:api_key]}"
@hslatman
hslatman / README.md
Created November 7, 2018 09:48 — forked from maxcnunes/README.md
Forwarding TCP-traffic to a UNIX socket

Base Command

socat -d -d TCP4-LISTEN:15432,fork UNIX-CONNECT:/srv/mongodb-27017.sock

Final Script

./forward-port-to-socket.sh 15432 /srv/mongodb-27017.sock
@hslatman
hslatman / fluent-filebeat-comparison.md
Created November 7, 2018 09:27 — forked from StevenACoffman/fluent-filebeat-comparison.md
Fluentd Fluent-bit FileBeat memory and cpu resources

Fluent-bit rocks

A short survey of log collection options and why you picked the wrong one. 😜

Who am I? Where am I from?

I'm Steve Coffman and I work at Ithaka. We do JStor (academic journals) and other stuff. How big is it?

Number what it means
101,332,633 unique visitors in 2017

A number of tech news outlets, including WIRED, GigaOm, and MIT Technology Review, have recently started writing about Multipeer Connectivity ("one weird trick that the NSA hates"). Since the NSHipster article on the subject has been linked to in a lot of this coverage, I wanted to share some additional thoughts on the matter:

Multipeer Connectivity(http://nshipster.com/multipeer-connectivity/) represents a significant shift in the opposite direction of how we conventionally think about mobile applications. Nearly every app on your phone operates in a client-server model, with the device making requests to remote cloud services to send and receive messages, photos, and videos. The [

@hslatman
hslatman / Bindings.swift
Created October 18, 2018 11:25 — forked from stinger/Bindings.swift
KVO-driven model bindings
extension NSObjectProtocol where Self: NSObject {
func observe<Value>(_ keyPath: KeyPath<Self, Value>, onChange: @escaping (Value) -> ()) -> NSKeyValueObservation {
return observe(keyPath, options: [.initial, .new]) { _, change in
// TODO: change.newValue should never be `nil`, but when observing an optional property that's set to `nil`, then change.newValue is `nil` instead of `Optional(nil)`. This is the bug report for this: https://bugs.swift.org/browse/SR-6066
guard let newValue = change.newValue else { return }
onChange(newValue)
}
}
func bind<Value, Target>(_ sourceKeyPath: KeyPath<Self, Value>, to target: Target, at targetKeyPath: ReferenceWritableKeyPath<Target, Value>) -> NSKeyValueObservation {
@hslatman
hslatman / hello.h
Created October 18, 2018 11:02 — forked from ddrccw/hello.h
detect jailbreak
//
// Created by ddrccw on 14-1-10.
// Copyright (c) 2014年 ddrccw. All rights reserved.
// refer to http://danqingdani.blog.163.com/blog/static/1860941952012102122847478/
#import <sys/stat.h>
#import <mach-o/dyld.h>
//#import <stdlib.h>
//#import <string.h>
@hslatman
hslatman / RX Generic Network Loader.swift
Created October 16, 2018 21:53
A generic loader for any sort of data. Just fill out the inputs.
struct LoadInput<T, U> {
let trigger: Observable<T> /// will cause the network request to start passing the T to the request generator.
let makeRequest: (T) -> URLRequest /// a function that knows how to create the URLRequest
let download: (URLRequest) -> Observable<Data> /// the function that actually does the download. By default, it uses URLSession.shared
let makeObject: (Data) -> U /// a function that knows how to convert the data into the needed resource.
}
extension LoadInput {
init(trigger: Observable<T>, makeRequest: @escaping (T) -> URLRequest, makeObject: @escaping (Data) -> U) {
self.trigger = trigger
@hslatman
hslatman / Decodable+Random.swift
Created October 6, 2018 15:57 — forked from IanKeen/Decodable+Random.swift
Custom Decoder that can be used to create Decodable instances that are populated with random values
public extension Decodable {
static func randomInstance() throws -> Self {
let decoder = _RandomDecoder()
return try Self(from: decoder)
}
}
public class RandomDecoder {
public func decode<T: Decodable>(_: T.Type) throws -> T {
let decoder = _RandomDecoder()