This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Silly little XCode Playground for experimenting with the Secure Enclave programming. | |
// See more at https://developer.apple.com/videos/play/wwdc2019/709 | |
// and also sample code at https://developer.apple.com/documentation/cryptokit/performing_common_cryptographic_operations | |
import UIKit | |
import CryptoKit | |
import LocalAuthentication | |
// Get access to secure enclave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu -o pipefail | |
########################################################################### | |
# zombie_branches.sh: Prune dead branches that don't exist in the upstream | |
# | |
# Author: @a10y | |
# Date: 22 June 2023 | |
########################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
def parse_diarization(inf): | |
with open(inf, "r") as f: | |
return json.load(f) | |
def parse_speech(inf): | |
with open(inf, "r") as f: | |
return json.load(f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Translate a given input text file with a sequence of nucleic acid (A/C/G/T) DNA base | |
pairs into amino acid 1-letter codes. | |
Authori: @a10y | |
""" | |
AMINOS_TABLE = { | |
'ATA':'I', 'ATC':'I', 'ATT':'I', 'ATG':'M', | |
'ACA':'T', 'ACC':'T', 'ACG':'T', 'ACT':'T', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { serve } from "https://deno.land/std@0.140.0/http/server.ts"; | |
serve(async (request) => { | |
const worker = new Worker(new URL("./worker.ts", import.meta.url).href, { | |
type: "module", | |
name: "worker-" + (100 * Math.random()).toFixed(), | |
}); | |
const data = await request.json(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// rtsp_streamer.m | |
// dccameras | |
// | |
// Created by Andrew Duffy on 1/15/22. | |
// | |
#import <Foundation/Foundation.h> | |
#import <ffmpegkit/FFmpegKit.h> | |
#import <libavcodec/avcodec.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Use this file to import your target's public headers that you would like to expose to Swift. | |
// | |
#include "rtsp_streamer.h" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Detect vertical edges using a convolution filter encoded via PyTorch. | |
Hooked up to FaceTime camera on macbook | |
""" | |
from torchvision import transforms | |
from PIL import Image | |
import torch | |
import torch.nn as nn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import torch | |
from torch import nn | |
from torch.optim import SGD | |
# Train a network to recognize the function y=2x+3 | |
class LinReg(nn.Module): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ :: python -m timeit -v -s 'import pyorbital.orbital as O; from numpy import atleast_1d; from datetime import datetime;' 'Az, Elev = O.get_observer_look(atleast_1d(10), atleast_1d(10), atleast_1d(50_000), datetime.utcnow(), atleast_1d(10), atleast_1d(10), atleast_1d(6_00))' | |
1 loop -> 0.00024 secs | |
2 loops -> 0.000296 secs | |
5 loops -> 0.000333 secs | |
/Users/andrew/miniforge3/lib/python3.9/site-packages/pyorbital/orbital.py:129: RuntimeWarning: invalid value encountered in true_divide | |
az_ = np.arctan(-top_e / top_s) | |
/Users/andrew/miniforge3/lib/python3.9/site-packages/pyorbital/orbital.py:149: RuntimeWarning: invalid value encountered in arcsin | |
el_ = np.arcsin(top_z / rg_) | |
10 loops -> 0.000919 secs | |
/Users/andrew/miniforge3/lib/python3.9/site-packages/pyorbital/orbital.py:129: RuntimeWarning: divide by zero encountered in true_divide |