Skip to content

Instantly share code, notes, and snippets.

@kalm42
kalm42 / Person.swift
Created April 22, 2017 18:10
Swift error with nested init
struct Address {
let locationName: String?
let line1: String
let line2: String?
let line3: String?
let city: String
let state: String
let zip: String
init(dictionary: [String:String]) {
@kalm42
kalm42 / ColorPicker.js
Created October 29, 2018 03:03
React component to pick colors.
import React, { Component } from "react";
import PropTypes from "prop-types";
import styled from "styled-components";
const ColorPickerWrapper = styled.div`
width: 100%;
background-color: white;
padding: 40px 0;
`;
@kalm42
kalm42 / Resulting JSON
Last active November 26, 2018 19:00
WordPress File Upload
"media_details": {
"width": 4000,
"height": 2668,
"file": "2018/11/IMG_2344.jpg",
"sizes": {
"thumbnail": {
"file": "IMG_2344-150x150.jpg",
"width": 150,
"height": 150,
"mime_type": "image/jpeg",
@kalm42
kalm42 / FatSample.swift
Created March 8, 2017 04:45
Health Store
class HealthData {
//MARK: - Class Properties
private let healthStore = HKHealthStore()
private let queue = DispatchQueue(label: "com.kalm42.your-fat.hd", attributes: .concurrent)
private let group = DispatchGroup()
var perferredUnitOfMeasurement: UnitOfMeasurement = .lb
var isFinishedLoading: Bool = false
//HealthKit variables
private var hkUnitOfMeasurement = HKUnit.pound()
@kalm42
kalm42 / us-addresses-for-address-verification.txt
Created March 13, 2024 16:00
List of real US addresses for address verification
777 Brockton Avenue, Abington MA 2351
30 Memorial Drive, Avon MA 2322
250 Hartford Avenue, Bellingham MA 2019
700 Oak Street, Brockton MA 2301
66-4 Parkhurst Rd, Chelmsford MA 1824
591 Memorial Dr, Chicopee MA 1020
55 Brooksby Village Way, Danvers MA 1923
137 Teaticket Hwy, East Falmouth MA 2536
42 Fairhaven Commons Way, Fairhaven MA 2719
374 William S Canning Blvd, Fall River MA 2721