Skip to content

Instantly share code, notes, and snippets.

View tschoffelen's full-sized avatar

Thomas Schoffelen tschoffelen

View GitHub Profile
@DavidWells
DavidWells / user-feedback.md
Created February 15, 2020 22:47
Don Norman quote from The Invisible Computer

Don Norman quote from The Invisible Computer:

"Don’t ask people what they want. Watch them and figure out their needs. If you ask, people usually focus on what they have and ask for it to be better: cheaper, faster, smaller. A good observer might discover that the task is unnecessary, that it is possible to restructure things or provide a new technology that eliminates the painstaking parts of their procedures. If you just follow what people ask for, you could end up making their lives even more complicated."

@slorber
slorber / react-navigation-tree.jsx
Last active August 13, 2022 19:17
react-navigation-tree.jsx
const App = createAppContainer(
createStack({
LoggedSwitch: createSwitch({
// When user is authenticated
LoggedIn: createStack({
// The logged in root is generally a tab or drawer navigator
LoggedInRoot: createTabsOrDrawer({
@felipetavares
felipetavares / simple_useful_slow.js
Last active December 15, 2020 12:39
Simple, Useful and Slow: Assorted Reference Statistics Functions (utf-8)
// Simple, Useful and Slow
// Assorted Reference Statistics Functions
// UTF-8 Edition
// Shorthands
pow = Math.pow
sqrt = Math.sqrt
pi = Math.PI
@mndrix
mndrix / sms.go
Last active June 23, 2020 17:20
SMS over IRC
// A proxy for sending/receiving SMS via IRC
//
// This code is part of our family IRC server whose code is available at
// https://gist.github.com/mndrix/7947009178e4a18c247b4bd25821661f
//
// This file won't compile by itself because it's only one file from
// my larger family server (movie hosting, Asterisk dialplan, Git
// hosting, personal assistant, etc).
//
// Copyright 2018 Michael Hendricks
@JoshOrndorff
JoshOrndorff / pi.k
Last active June 5, 2018 20:44
My work-in-progress pi-calculus in k framework
module PI-SYNTAX
imports DOMAINS
// Processes
syntax Proc ::= Norm // Normal processes are still processes
| Proc "|" Proc // Parallel
| "!" Proc // Replication
| "(" "v" Id ")" Proc // New name
| "(" Proc ")" // Allow parens for grouping
@so0k
so0k / alpine-curl.md
Created March 1, 2018 03:00
Alpine curl issues

To fix /usr/bin/curl: curl_mime_type: symbol not found Errors when trying to run curl in a running alpine pod.

Right solution: Update base alpine image because this is a bigger issue

Quick fix: run Alpine system upgrade (or upgrade libcurl package specifically):

apk update
apk upgrade
@j-fischer
j-fischer / incomingCalls.js
Last active October 28, 2021 02:49
Twilio functions to forward phone calls to multiple cell phones. See https://cloudthingsyyc.wordpress.com/2018/01/15/hpaas-home-phone-as-a-service/ for more details.
const format = require('string-format');
// These are the numbers to forward the call to
const destinations = ['+1', '+1'];
// These are the numbers that will be forwarded to the cell phones
const allowedCallers = [
'+1', //
];
@jmadden
jmadden / forward_to_first_number.xml
Last active September 1, 2022 22:28
TwiML Incoming Calls - Forward call to numbers in order. Fire off VMail and send SMS on no answer
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<!-- Forward to first number and if no answer, action URL points to second number to try -->
<Dial timeout="15" action="forward_to_second_number.xml">
<Number url="whisper_instructions.xml">+15554441212</Number>
</Dial>
</Response>
<?php
/**
* Assumes https://github.com/Spomky-Labs/jose library is installed and autoloading is set up
* Decode and verify token guide: https://github.com/Spomky-Labs/jose/blob/master/doc/operation/Verify.md
*/
use Jose\Factory\JWKFactory;
use Jose\Loader;
// We load the key set from a URL
// JSON Key URL (JKU) - https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/jwks.json.

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.