Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
cd /
sudo apt update
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
@DiogenesAnalytics
DiogenesAnalytics / country-codes.csv
Last active May 31, 2024 19:19 — forked from ilyankou/country-codes
200 ISO2/ISO3 Country Codes
Country ISO2 ISO3
Afghanistan AF AFG
Albania AL ALB
Algeria DZ DZA
Andorra AD AND
Angola AO AGO
Antigua and Barbuda AG ATG
Argentina AR ARG
Armenia AM ARM
Australia AU AUS
@DiogenesAnalytics
DiogenesAnalytics / converting_keras_model.py
Created January 10, 2024 02:21 — forked from Namburger/converting_keras_model.py
Example of creating a dummy keras model and convert it to tflite with tensorflow1.15
import tensorflow as tf
if not str(tf.__version__).startswith('1.15'):
print('please use tensorflow 1.15')
exit()
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Conv2D
tf.enable_eager_execution()
image_shape = (64,64,3)
@DiogenesAnalytics
DiogenesAnalytics / rename-pictures.sh
Created December 31, 2023 15:00 — forked from jart/rename-pictures.sh
Shell script for renaming all images in a folder
#!/bin/sh
# rename-pictures.sh
# Author: Justine Tunney <jtunney@gmail.com>
# License: Apache 2.0
#
# This shell script can be used to ensure all the images in a folder
# have good descriptive filenames that are written in English. It's
# based on the Mistral 7b and LLaVA v1.5 models.
#
# For example, the following command:
@DiogenesAnalytics
DiogenesAnalytics / preprocess_dataset.py
Created December 22, 2023 22:25 — forked from himanshurawlani/preprocess_dataset.py
Pre-processing the dataset download using tfds.load()
def format_example(image, label):
image = tf.cast(image, tf.float32)
# Normalize the pixel values
image = image / 255.0
# Resize the image
image = tf.image.resize(image, (IMG_SIZE, IMG_SIZE))
return image, label
train = raw_train.map(format_example)
validation = raw_validation.map(format_example)
@DiogenesAnalytics
DiogenesAnalytics / machina.py
Created December 15, 2023 18:46 — forked from RagingTiger/machina.py
Python Script seen over Caleb's Shoulder in Deus Ex Machina
# BlueBook code decryption
import sys
def sieve(n):
# Compute primes using sieve of Eratosthenes
x = [1]*n
x[1] = 0
@DiogenesAnalytics
DiogenesAnalytics / name_of_god.txt
Created December 15, 2023 18:46 — forked from RagingTiger/name_of_god.txt
Number printed to screen in the Aronofsky film Pi when Max first finds the number
94143243431512659321054872390486828512913474876027
67195923460328582958304725016523252592969257276553
64363462727184012012643147546329450127847264841075
62234789626728592858295347502772262646456217613984
829519475412398501
@DiogenesAnalytics
DiogenesAnalytics / quine.py
Created December 15, 2023 18:46 — forked from RagingTiger/quine.py
Lex Fridman - Quine Example
# Ref: https://youtu.be/a-zEbokJAgY
# quine
s='s=%r;print(s%%s)';print(s%s)
# interactive intron
t='';s='t=input()or t;print(f"t={repr(t)};s={repr(s)};exec(s)#{t}")';exec(s)#
@DiogenesAnalytics
DiogenesAnalytics / art_of_war.txt
Created December 15, 2023 18:46 — forked from RagingTiger/art_of_war.txt
Various quotes from the Art of War by Sun Tzu
“Quickness is the essence of the war.” – Sun Tzu
“To know your Enemy, you must become your Enemy.” – Sun Tzu
“If your enemy is secure at all points, be prepared for him. If he is in superior strength, evade him. If your opponent is temperamental, seek to irritate him. Pretend to be weak, that he may grow arrogant. If he is taking his ease, give him no rest. If his forces are united, separate them. If sovereign and subject are in accord, put division between them. Attack him where he is unprepared, appear where you are not expected.” – Sun Tzu
“Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat.” – Sun Tzu
“There are not more than five musical notes, yet the combinations of these five give rise to more melodies than can ever be heard.There are not more than five primary colors, yet in combination they produce more hues than can ever been seen.There are not more than five cardinal tastes, yet combinations of them yield more flavors t
@DiogenesAnalytics
DiogenesAnalytics / config_git_credentials.sh
Created December 15, 2023 18:46 — forked from RagingTiger/config_git_credentials.sh
Configure Git credentials for when using multipe GitHub accounts.
git_config_author(){
git config --local user.name "${1}"
git config --local user.email "${2}"
}
git_config_sshkey(){
# get ssh hosts
local ssh_hosts="$(grep "github.com-[a-Z]*" ~/.ssh/config | \
awk '{print $2}' | sed 's/github\.com-//g' | tr '\n' ' ')"