Skip to content

Instantly share code, notes, and snippets.

@diemer
diemer / in-app-tour.swift
Last active September 6, 2022 21:18
Simple SwiftUI In App Tour sketch
import SwiftUI
struct ContentView: View {
@State var infoIndex: Int = 0
typealias TourPOI = (point: UnitPoint, radii: (start: CGFloat, end: CGFloat))
var infos: [TourPOI] = [
// UnitPoint is a value between 0 and 1,
// x represents the percentage of width,
// y represents the percentage of height
(point: .init(x: 0.75, y: 0.05), radii: (start: 0, end: 90)),

Keybase proof

I hereby claim:

  • I am diemer on github.
  • I am diemer (https://keybase.io/diemer) on keybase.
  • I have a public key ASC8wLcAmlH3SEVpwwvBun7PmATuRoo5I9LS7NZYtox2vgo

To claim this, I am signing this object:

@diemer
diemer / setup.sh
Last active June 28, 2017 17:57 — forked from ugate/setup.sh
NTC C.H.I.P. setup script
#!/bin/bash
LC_ALL=en_US.UTF-8
# configures/installs common CHIP features (including enabling disabled ones)
# run 'sudo chmod +x setup.sh && ./setup.sh' to run the installation
clear
res=
dtc=
rboot=
uname -a
cat << _EOF_
@diemer
diemer / prime_sieve.rb
Last active October 4, 2016 05:36
An implementation of the Sieve of Eratosthenes in Ruby
# An implementation of the Sieve of Eratosthenes in Ruby
# I recently read about it in The Imposter's Handbook(https://bigmachine.io/products/the-imposters-handbook)
# and thought it would be a fun experiment to try to code, just off the
# description and the example animation on
# Wikipedia(https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes)
class PrimeSieve
def initialize(max)
@numbers = (2...max).to_a
@current_prime = 2
@diemer
diemer / MY_Exceptions.php
Created December 5, 2012 16:56
CodeIgniter - Log controller/method where error occurred
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Exceptions extends CI_Exceptions {
// this file goes in application/core
public function __construct()
{
$this->ob_level = ob_get_level();
// Note: Do not log messages from this constructor.
}
@diemer
diemer / gist:3306841
Created August 9, 2012 18:28
Freeform problem
{exp:freeform:form form_id="2" return="contact_us/thank_you"}
{freeform:field:cell_phone}
{freeform:captcha}
{freeform:submit}
{/exp:freeform:form}