Skip to content

Instantly share code, notes, and snippets.

@kylehowells
kylehowells / locales.txt
Last active June 30, 2020 21:38
[SFSpeechRecognizer supportedLocales] on macOS 10.15.5
Arabic (Saudi Arabia) (ar-SA)
Catalan (Spain) (ca-ES)
Czech (Czechia) (cs-CZ)
Danish (Denmark) (da-DK)
German (Austria) (de-AT)
German (Switzerland) (de-CH)
@kylehowells
kylehowells / Speedo.swift
Created June 28, 2020 17:37
Scifi Style Speedometer Concept in SwiftUI
import SwiftUI
struct ContentView: View {
let backgroundGradient = Gradient(colors: [
Color(red: 65.0/255.0, green: 65.0/255.0, blue: 84.0/255.0, opacity: 1.0),
Color(red: 20.0/255.0, green: 20.0/255.0, blue: 24.0/255.0, opacity: 1.0)
])
let blueGradient = Gradient(colors: [
@kylehowells
kylehowells / GradientText.swift
Created June 27, 2020 22:58
SwiftUI gradient text fill
struct GradientText: View {
@State var text: String
@State var gradient:LinearGradient = LinearGradient(
gradient: Gradient(colors: [.white, .gray]),
startPoint: .top,
endPoint: .bottom
)
var body: some View {
@kylehowells
kylehowells / style.css
Last active June 26, 2020 02:02
Hide Twitter Trending using StopTheMadness + Safari custom CSS file
html[stopthemadness-href^="https://twitter.com"] div[data-testid="sidebarColumn"] div[aria-label="Timeline: Trending now"] {
display: none !important;
}
@kylehowells
kylehowells / custom.css
Last active June 24, 2020 15:28
Custom CSS style for Github using StopTheMadness
@charset "UTF-8";
html[stopthemadness-href^="https://github.com"] .Box--responsive .Box-header {
background: linear-gradient(#f8f8f8, #f5f5f5) !important;
border-bottom: 1px solid #dfdfdf;
}
html[stopthemadness-href^="https://github.com"] .btn-primary {
background: linear-gradient(#28d959, #25be50);
}

Keybase proof

I hereby claim:

  • I am kylehowells on github.
  • I am ikyle (https://keybase.io/ikyle) on keybase.
  • I have a public key whose fingerprint is 5F14 2172 F0A6 9E0E C80E D42B 1B56 EC16 B847 BB60

To claim this, I am signing this object:

@kylehowells
kylehowells / correct_dates.py
Created February 14, 2020 21:18
Automatically Corrects Insta360 Studio Snapshot Dates according to the filename.
import os
import re
import datetime
import piexif
filepath = os.path.abspath(".")
# Find files with `screenshot` in the name.
files = [f for f in os.listdir(filepath) if "screenshot" in f and f.endswith(".jpg")]
print(files)
@kylehowells
kylehowells / ast2text.py
Created January 15, 2020 02:45
Extract the plain text from markdown, for plain text search. (using the mistletoe markdown library)
import mistletoe
with open('test.md', 'r') as myfile:
text = myfile.read()
doc = mistletoe.Document(text)
# Returns the text from markdown, stripped of the markdown syntax itself
def ast2text(node):
content = ""
@kylehowells
kylehowells / ast2text.py
Last active April 8, 2021 22:10
Extract the plain text from markdown, for plain text search.
import commonmark
with open('test.md', 'r') as myfile:
text = myfile.read()
parser = commonmark.Parser()
ast = parser.parse(text)
# Returns the text from markdown, stripped of the markdown syntax itself
def ast2text(astNode):
@kylehowells
kylehowells / FileWatcher.cs
Created May 9, 2019 13:06
Monitor iOS files for changes using GCD dispatch_source_create DISPATCH_SOURCE_TYPE_VNODE in Xamarin
using System;
using ObjCRuntime;
using Foundation;
using CoreFoundation;
using System.IO;
namespace LoadRuntimeXAML.iOS
{
public class FileWatcher : IDisposable
{