Skip to content

Instantly share code, notes, and snippets.

View Andrew-Pynch's full-sized avatar
🎯
Focusing

Andrew Pynch Andrew-Pynch

🎯
Focusing
View GitHub Profile
#!/bin/bash
# make sure to install dependencies
# sudo apt-get install maim xclip
# if you want to make this action hotkeyable add the following lines to your
# .zshrc or .bashrc file
# alias segmented_screenshot='~/Linux-Setup-Scripts/scripts/take_segmented_screenshot.sh'
# bindkey -s '^x' 'segmented_screenshot\n' # this will bind segmented screenshot to ctrl + x
alias gcl='CloneAndrewRepo'
alias gpl='git pull'
alias gaa='git add --all'
alias gam='git commit -a -m'
alias gampu='AddCommitAndPush'
alias gpu='git push'
alias gba='git branch -a'
alias gb='git branch'
alias gc='git checkout'
alias gbgc='BranchAndCheckout'
@Andrew-Pynch
Andrew-Pynch / hiragana-to-romanji.ts
Created April 20, 2023 13:59
Typescript hiragana to romanji map
const hiraganaToRomajiMap: Map<string, string> = new Map([
['あ', 'a'],
['い', 'i'],
['う', 'u'],
['え', 'e'],
['お', 'o'],
['か', 'ka'],
['き', 'ki'],
['く', 'ku'],
['け', 'ke'],
@Andrew-Pynch
Andrew-Pynch / english_alphabet
Created March 16, 2022 01:41
line separated english alphabet
a
b
c
d
e
f
g
h
i
j
int rows, cols;
int scl = 20;
int w = 2920;
int h = 1080;
float flying = 0;
// 2d array in java
float[][] terrain;
import cv2
import numpy as np
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
REBUILD_DATA = False # set to true to one once, then back to false unless you want to change something in your training data.
# Ping PLC
ping -t 10.114.4.10 > C:\Users\apynch\Github\scripts\ignition.txt
# Ping google
ping -t google.com > C:\Users\apynch\Github\scripts\google.txt
new_q = (1 - LEARNING_RATE) * current_q + LEARNING_RATE * (reward + DISCOUNT * max_future_q)
q_table[observation][action] = reward
def crop_lower_half(fnames): # fnames is a list of jpg names in a folder
for i, file in enumerate(fnames):
cropped_image = crop(open_image(jpg_extractions[i]), 1910, 1.29995, 0)
print(i)
print(file)
cropped_image.save("/home/andrew/Github/neuralink-bot/image_manipulation/cropped_jpgs/top_crop/top_crop_%s.jpg" % (str(i)))
import sys
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
import cv2
vidcap = cv2.VideoCapture('neuralink3.mp4')
success,image = vidcap.read()
count = 0
while success: