Skip to content

Instantly share code, notes, and snippets.

@timbueno
timbueno / EqualWidthModifier.swift
Created August 11, 2023 22:31
SwiftUI view modifier that matches the width of two views using PreferenceKeys
// Copyright © 2023 Tim Bueno. All rights reserved.
import SwiftUI
struct EqualWidthPreferenceKey: PreferenceKey {
typealias Value = CGFloat
static var defaultValue: CGFloat = 0
static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) {
value = nextValue()
}
@timbueno
timbueno / bagplaybook_bueno
Created August 25, 2013 05:38
ansible gist that i cannot get quite right
---
- hosts: webservers
user: vagrant
sudo: true
tasks:
- name: System | Add supervisor group to system
group: name=supervisor state=present
- name: System | Create new user
@timbueno
timbueno / weather.py
Created May 13, 2012 23:32 — forked from jleclanche/weather.py
Quick python weather script using Google's Weather API
#!/usr/bin/env python
# encoding: utf-8
import sys
from argparse import ArgumentParser
from xml.dom import minidom
try:
from urllib.request import urlopen
from urllib.parse import urlencode
except ImportError: