Skip to content

Instantly share code, notes, and snippets.

@wvteijlingen
wvteijlingen / default-gems-10.10.4.txt
Last active August 29, 2015 14:27
Default gems OS 10.10.4
bigdecimal (1.2.0)
CFPropertyList (2.2.8)
io-console (0.4.2)
json (1.7.7)
libxml-ruby (2.6.0)
minitest (4.3.2)
nokogiri (1.5.6)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
retina-background(url, width, height)
dir = dirname(url)
ext = extname(url)
base = basename(url, ext)
background-image: url(dir '/' base ext)
@media (-webkit-min-device-pixel-ratio: 2),
(min--moz-device-pixel-ratio: 2),
(-o-min-device-pixel-ratio: 2/1),
(min-device-pixel-ratio: 2),
@wvteijlingen
wvteijlingen / index.js
Last active July 20, 2019 12:36
HOC for react-navigation that maps params to props
import paramsToProps from 'paramsToProps.js'
const MainNavigator = StackNavigator({
firstScreen: { screen: paramsToProps(FirstScreenComponent) },
secondScreen: { screen: paramsToProps(SecondScreenComponent) },
});
@wvteijlingen
wvteijlingen / use-toggle.ts
Created October 30, 2019 18:50
react-native-use-toggle
import { useState } from "react"
export function useToggle(initialState: boolean = false): [boolean, () => void] {
const [state, setState] = useState<boolean>(initialState)
return [
state,
() => setState(!state)
]
}
@wvteijlingen
wvteijlingen / Protected songs.scpt
Created November 15, 2019 19:34
Finds all purchased songs that are DRM protected, and adds them to a "Protected songs" playlist
-- Finds all purchased songs that are DRM protected, and adds them to a "Protected songs" playlist
tell application "iTunes"
set aPlaylist to (make new user playlist with properties {name:"Protected songs"})
repeat with aTrack in tracks of library playlist 1
if purchaser Apple ID of aTrack is not missing value and kind of aTrack is "Protected AAC audio file" then
duplicate aTrack to aPlaylist
end if
end repeat
end tell

Hierbij mijn lijst. Sorry dat het een beetje veel is geworden. Ik heb gewoon de app doorgelopen en opgeschreven wat me te binnen schoot. Om het een beetje behapbaarder te maken heb ik het wel onderverdeeld in categorieën.

Customer Journey

Autocheck De autocheck is volgens mij een van de kernpunten die we aanbieden met Smart Driver. Ik vind dat dit wel wat meer naar voren zou mogen komen in de app; de customer journey voor autocheck is eigenlijk gewoon non existent.

De enige informatie over de check is de summiere tekst in de bottom sheet als je het invite-item opent, en zelfs daarin staat eigenlijk niet uitgelegd hoe het werkt en wat we doen. De autocheck invite-detailpagina is nu alleen een functionele lijst met checkmarks en een belknop. Het is niet echt enthousiasmerend, terwijl het toch best een mooie service is die ANWB ook promoot in haar marketing.

Opt-in voor locatie

import CallKit
import Foundation
class PhoneCaller: NSObject {
typealias OnCallConnected = () -> Void
static let shared: PhoneCaller = PhoneCaller()
private let observer = CXCallObserver()
private var isCalling: Bool = false
# Very naive way of finding files that are in the filesystem but not added to an Xcode project
proj = File.read("path-to-project.pbxproj")
puts Dir.glob("./**/*.swift")
.map { |e| File.basename(e) }
.reject { |e| proj.include?(e) }
@wvteijlingen
wvteijlingen / Welcome to Gistblog.md
Last active February 20, 2023 16:06
blog/Welcome to Gistblog!
excerpt
Gistblog is a website that turns your Github gists into a blog! Simple write a gist, prefix the name with `blog/`, and it will show up on `gistblog.land/your-github-username`

Welcome to Gistblog!

Gistblog is a website that turns your Github gists into a blog! Simple write a gist, prefix the name with blog/, and it will show up on gistblog.land/your-github-username.

Why should I use Gistblog?

@wvteijlingen
wvteijlingen / RetryStrategy.swift
Last active March 4, 2024 17:10
Swift RetryStrategy
public protocol RetryStrategy {
/// True if the strategy allows to retry a failed action. False if all the retries have been 'used up'.
var shouldRetry: Bool { get }
/// The delay for which to wait before attempting to retry a failed action.
var delay: TimeInterval { get }
/// Returns a copy of this retry strategy with the number of allowable retries lowered by one.
var consumedOnce: Self { get }
}