Skip to content

Instantly share code, notes, and snippets.

View matteocrippa's full-sized avatar

Matteo Crippa matteocrippa

View GitHub Profile
@joshnuss
joshnuss / ble_speedometer_esp32.ino
Last active August 17, 2023 21:46
Bluetooth Speedometer using ESP32 and Hall effect sensor
/*
* Using digital hall effect sensor SENS-M-10 (purchased at Abra)
*
* MCU Board: ESP2-WROOM-32
*/
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
@brucebentley
brucebentley / iOS Shortcuts Catalog.md
Last active April 23, 2024 06:39
This is a public resource designed to help people get started with Siri Shortcuts & the Shortcuts app. It’s made up of the Shortcuts Library, a collection of over 125+ shortcuts grouped into folders, and the Action Directory, a documentation of 125+ of the actions in the Shortcuts app used to build shortcuts.

Bruce's iOS Shortcut Catalog

Hello and welcome to my Shortcuts Catalog!

This is a public resource designed to help people get started with Siri Shortcuts and the Shortcuts app.

It’s made up of the Shortcuts Library, a collection of over 125+ shortcuts grouped into folders, and the Action Directory, a documentation of 125+ of the actions in the Shortcuts app used to build shortcuts.

Enjoy!

import Combine
import Foundation
enum RequestError: Error {
case urlError(URLError)
case decodingError(DecodingError)
case genericError(Error)
}
class NetworkClient {
@kevinkub
kevinkub / scriptable-line-chart.js
Last active February 1, 2024 15:18
Simple line chart class for https://scriptable.app 📈
class LineChart {
// LineChart by https://kevinkub.de/
constructor(width, height, values) {
this.ctx = new DrawContext();
this.ctx.size = new Size(width, height);
this.values = values;
}
_calculatePath() {
@pmkay
pmkay / top-brew-packages.txt
Last active May 4, 2024 13:12 — forked from r5v9/top-brew-packages.txt
Top homebrew packages
node: Platform built on V8 to build network applications
git: Distributed revision control system
wget: Internet file retriever
yarn: JavaScript package manager
python3: Interpreted, interactive, object-oriented programming language
coreutils: GNU File, Shell, and Text utilities
pkg-config: Manage compile and link flags for libraries
chromedriver: Tool for automated testing of webapps across many browsers
awscli: Official Amazon AWS command-line interface
automake: Tool for generating GNU Standards-compliant Makefiles
@Akhu
Akhu / CoreData + Codable.swift
Created May 11, 2018 09:46
Mixing Codable and Core Data in Swift
//
// Article.swift
// Veille
//
// Created by Anthony Da Cruz on 26/01/2018.
// Copyright © 2018 Anthony Da Cruz. All rights reserved.
//
import Foundation
import CoreData
@dannote
dannote / final-cut-pro-trial-reset.swift
Last active April 17, 2024 10:39
Final Cut Pro X trial reset
#!/usr/bin/swift
import Foundation
let path = URL(fileURLWithPath: NSString(string: "~/Library/Application Support/.ffuserdata").expandingTildeInPath)
let data = try! NSData(contentsOf: path) as Data
let dictionary = try! NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) as! NSDictionary
let mutableDictionary = dictionary.mutableCopy() as! NSMutableDictionary
for (key, value) in mutableDictionary {
@matteocrippa
matteocrippa / mac-setup.sh
Last active February 26, 2024 12:08
A script to automate the setup of a development oriented Macbook machine
#!/usr/bin/env bash
# Brew
echo "Installing 🍺 Brew!"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "eval $(/opt/homebrew/bin/brew shellenv)" >> .zshrc
# Tap
brew tap homebrew/bundle
brew tap homebrew/core
@richard512
richard512 / geo-distance-calc.md
Last active November 5, 2021 03:23
Calculate distance between lat long coordinates in excel / libre calc

Using variables

=ACOS(COS(RADIANS(90-Lat1)) *COS(RADIANS(90-Lat2)) +SIN(RADIANS(90-Lat1)) *SIN(RADIANS(90-Lat2)) *COS(RADIANS(Long1-Long2))) *6371

Using Cell References

=ACOS(COS(RADIANS(90-A2)) *COS(RADIANS(90-A3)) +SIN(RADIANS(90-A2)) *SIN(RADIANS(90-A3)) *COS(RADIANS(B2-B3))) *6371

That'll work for a table set up like this:

Name Lat Long