Skip to content

Instantly share code, notes, and snippets.

@mikebuss
mikebuss / decode-json-swift.swift
Created January 25, 2019 21:46
Decode [Any] and [String: Any] Swift 4
//
//
// Adapted from:
//
// Original: https://gist.github.com/loudmouth/332e8d89d8de2c1eaf81875cfcd22e24
// Adds encoding: https://github.com/3D4Medical/glTFSceneKit/blob/master/Sources/glTFSceneKit/GLTF/JSONCodingKeys.swift
// Adds fix for null inside arrays causing infinite loop: https://gist.github.com/loudmouth/332e8d89d8de2c1eaf81875cfcd22e24#gistcomment-2807855
//
struct JSONCodingKeys: CodingKey {
var stringValue: String
using NtApiDotNet;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 7, 2024 06:03
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@darconeous
darconeous / tesla-key-card-protocol.md
Last active May 7, 2024 06:02
Tesla Key Card Protocol

Tesla Key Card Protocol

Researched by Robert Quattlebaum darco@deepdarc.com.

Last updated 2020-02-03.

Image of Tesla Key Card Image of Tesla Model 3 Key Fob

@Integralist
Integralist / aspect_ratio.py
Last active May 7, 2024 05:59
[Calculate Aspect Ratio] #aspect #ratio #python
def calculate_aspect(width: int, height: int) -> str:
def gcd(a, b):
"""The GCD (greatest common divisor) is the highest number that evenly divides both width and height."""
return a if b == 0 else gcd(b, a % b)
r = gcd(width, height)
x = int(width / r)
y = int(height / r)
return f"{x}:{y}"
nodes:
- id: webcam
custom:
source: https://huggingface.co/datasets/dora-rs/dora-idefics2/raw/main/operators/opencv_stream.py
outputs:
- image
- id: idefics2
operator:
python: https://huggingface.co/datasets/dora-rs/dora-idefics2/raw/main/operators/idefics2_op.py
inputs:
[
{
"kana": "",
"roumaji": "a",
"type": "gojuuon"
},
{
"kana": "",
"roumaji": "i",
"type": "gojuuon"
[
{
"kana": "",
"roumaji": "a",
"type": "gojuuon"
},
{
"kana": "",
"roumaji": "i",
"type": "gojuuon"
@mcous
mcous / Makefile
Created July 3, 2013 16:26
Simple AVR Makefile template
# simple AVR Makefile
#
# written by michael cousins (http://github.com/mcous)
# released to the public domain
# Makefile
#
# targets:
# all: compiles the source code
# test: tests the isp connection to the mcu