Skip to content

Instantly share code, notes, and snippets.

View mikezucc's full-sized avatar
💭
everything all at once, like the old days

Michael Zuccarino mikezucc

💭
everything all at once, like the old days
  • Gatsby
  • United States
View GitHub Profile
@mikezucc
mikezucc / saucy.py
Created June 21, 2022 03:16
Recursively convert .tiffs to .jpgs
# python3
import os
from PIL import Image
yourpath = os.getcwd()
for root, dirs, files in os.walk(yourpath, topdown=False):
for name in files:
if ".tif" in os.path.splitext(os.path.join(root, name))[1].lower():
if os.path.isfile(os.path.splitext(os.path.join(root, name))[0] + ".jpg"):
print("A jpeg file already exists for %s" % name)
@mikezucc
mikezucc / post_assertion.py
Created December 3, 2018 21:25
Submit assert information to node back end, executed async via Popen
# import site
# sitepackagessite = site.getsitepackages()[0]
# if sitepackagessite not in sys.path:
# sys.path[0:0] = ['/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages']
# print sys.path
from os.path import expanduser
import sys
import requests
import json
@mikezucc
mikezucc / reportassertv1.py
Last active December 4, 2018 18:56
Version 1 of the assertion reporting platform
import lldb
import json
import subprocess
from os.path import expanduser
import time
import os
import sys
home = expanduser("~")
@mikezucc
mikezucc / stackpoint.py
Last active October 9, 2018 01:12
Stop debugger by loosely matching a stack frame
import lldb
"""
NOTE:
LLDB print adds a bunch of other stuff to the string like in this example
(lldb) script
-- ENTERED PYTHON REPL
>>> print lldb.frame.GetDisplayFunctionName()
::-[ASLayoutTransition applySubnodeInsertionsAndMoves]()
"""
import lldb
"""
NOTE:
LLDB print adds a bunch of other stuff to the string like in this example
(lldb) script
-- ENTERED PYTHON REPL
>>> print lldb.frame.GetDisplayFunctionName()
::-[ASLayoutTransition applySubnodeInsertionsAndMoves]()
"""
-(void) microphone:(EZMicrophone *)microphone
hasAudioReceived:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
dispatch_async(dispatch_get_main_queue(),^{
NSLog(@"\tbuffer size %ld", (long)bufferSize);
float buffInternal[557] = { 0 };
float *buffCopy[1] = {buffInternal};
memcpy(buffCopy, buffer, sizeof(buffCopy));
NSLog(@"first buffCopy %f", *buffCopy[0]);
import numpy as np
# ** DATASET **
# https://archive.ics.uci.edu/ml/machine-learning-databases/servo/
# ** DATASET **
# sigmoid function
def nonlin(x,deriv=False):
if(deriv==True):
@mikezucc
mikezucc / life.swift
Created May 22, 2017 01:28
Conway game of life in swift with 10x10 doomed seed
#!/usr/bin/swift
// ubuntu peeps this ones for you
// run export PATH=~/swift3/usr/bin/:"${PATH}" in pwd first
import Foundation
// ********************* debug *********************
let showDebug = false
func printS(_ output: String) {
if showDebug { print(output) }
}
@mikezucc
mikezucc / batchinterpret
Created February 28, 2017 07:32
Process every linear16 44.1khz audio file in same level directory through Google Speech API, returns single JSON keys are filenames
#!/usr/bin/env python
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software