Skip to content

Instantly share code, notes, and snippets.

View pichfl's full-sized avatar
👨‍🎨
No mistakes, only happy accidents.

Florian Pichler pichfl

👨‍🎨
No mistakes, only happy accidents.
View GitHub Profile
@pichfl
pichfl / oblique.js
Created October 16, 2023 17:59
Oblique Strategies for Scriptable.app
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-gray; icon-glyph: sticky-note;
const strategies = ["Abandon normal instruments","Accept advice","Accretion","A line has two sides","Allow an easement (an easement is the abandonment of a structure)","Are there sections? Consider transitions","Ask people to work against their better judgement","Ask your body","Assemble some of the instruments in a group and treat the group","Balance the consistency principle with the inconsistency principle","Be dirty","Breathe more deeply","Bridges -build -burn","Cascades","Change instrument roles","Change nothing and continue with immaculate consistency","Children's voices -speaking -singing","Cluster analysis","Consider different fading systems","Consult other sources -promising -unpromising","Convert a melodic element into a rhythmic element","Courage!","Cut a vital connection","Decorate, decorate","Define an area as 'safe' and use it as an anchor","Destroy -noth
@pichfl
pichfl / README.md
Last active December 29, 2023 08:12
Hand drawn 8×8px glcdfont for QMK or other projects using GLCD and variations of it

Preview

437-8x8

Caveats

Follows the code page with four exceptions until 0x9A / Ü. The remaining 5 symbols are selected dithered gray scale tiles.

| Glyph | Fill |

@pichfl
pichfl / incidence.js
Last active December 7, 2020 12:31 — forked from kevinkub/incidence.js
COVID-19 Inzidenz-Widget für iOS innerhalb Deutschlands 🇩🇪 - Ich empfehle die Nutzung des Originals! https://gist.github.com/kevinkub/46caebfebc7e26be63403a7f0587f664
// Forked from Keven Kub.
// See https://gist.github.com/kevinkub/46caebfebc7e26be63403a7f0587f664
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
const apiUrl = ({ longitude, latitude }) =>
`https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=GEN,cases7_per_100k&geometry=${longitude.toFixed(
3
)}%2C${latitude.toFixed(
3
)}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json`;
@pichfl
pichfl / MiteEntries.js
Last active October 6, 2020 07:58
https://scriptable.app script for your own mite.yo.lk widget. Fill in API key and account as necessary.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: orange; icon-glyph: stopwatch;
// mite.yo.lk API key
let apikey = '';
let account = '';
// ---
async function loadEntries() {
module.exports = {
defaultBrowser: 'Safari',
handlers: [
// Anything localhost should open in Edge
{
match: finicky.matchHostnames(['localhost']),
browser: 'Microsoft Edge',
},
// Launch Google Meet on my third user account
@pichfl
pichfl / example.hbs
Last active October 4, 2022 19:01
Media query helper for Ember.js
{{#if (match-media "(max-width:800px)")}}
MediaQuery matches
{{ else}}
MediaQuery doesn't match
{{/if}}
@pichfl
pichfl / now.json
Last active May 4, 2019 16:50
Now.sh config for Ember.js projects
{
"version": 2,
"name": "your-ember-app-name",
"builds": [{ "src": "package.json", "use": "@now/static-build" }],
"routes": [
{ "handle": "filesystem" },
{ "src": ".*", "dest": "/index.html" }
]
}
@pichfl
pichfl / UIImage+EdgeColor.swift
Created April 30, 2018 21:44
Calculate the average color of the edges of an UIImage
import UIKit
extension UIImage {
func edgeColor(_ insets: UIEdgeInsets = UIEdgeInsets(top: 10.0, left: 10.0, bottom: 10.0, right: 10.0), defaultColor: UIColor = .black) -> UIColor {
guard let pixelData = self.cgImage?.dataProvider?.data else {
return defaultColor
}
let data: UnsafePointer<UInt8> = CFDataGetBytePtr(pixelData)
let width = Int(self.size.width * self.scale)
Verifying my Blockstack ID is secured with the address 13GbhHKSAZRByGrREAcsTZwsjXm6YW2AwG https://explorer.blockstack.org/address/13GbhHKSAZRByGrREAcsTZwsjXm6YW2AwG
@pichfl
pichfl / simple-server.js
Created June 6, 2017 20:19
Never try to use this somewhere in production. Ever. I had to put this somewhere as I wrote this server without having access to any online docs, only an offline dump of the Node.js docs. Also no linter nor proper editor. For that I think, it turned out to be rather okay.
const http = require('http');
const { statSync, readFileSync, createReadStream } = require('fs');
const { join, extname, basename } = require('path');
const { networkInterfaces } = require('os');
const port = 3000;
const cwd = join(__dirname, 'dist');
const defaultFile = join(cwd, 'index.html');
const maxAge = 24 * 3600;
const mimeTypes = {