Skip to content

Instantly share code, notes, and snippets.

View jw910731's full-sized avatar

jw910731 jw910731

View GitHub Profile
@jw910731
jw910731 / CvEdge-nvidia.py
Last active July 10, 2019 07:46
FRC Stuff
import cv2
import numpy as np
import os
vidSrc = 0
# Capture Video
cap = cv2.VideoCapture(vidSrc)
os.system("./vidSetup.sh "+str(vidSrc))
# Color filter range
lowG = np.array([40,100,100])
highG = np.array([75,255,255])
@jw910731
jw910731 / .zsh_plugin
Last active October 4, 2019 06:59
Zsh Setting
robbyrussell/oh-my-zsh
robbyrussell/oh-my-zsh path:plugins/git
robbyrussell/oh-my-zsh path:plugins/pip
robbyrussell/oh-my-zsh path:plugins/bower
robbyrussell/oh-my-zsh path:plugins/node
robbyrussell/oh-my-zsh path:plugins/xcode
robbyrussell/oh-my-zsh path:plugins/osx
robbyrussell/oh-my-zsh path:plugins/colored-man-pages
robbyrussell/oh-my-zsh path:plugins/copyfile
robbyrussell/oh-my-zsh path:plugins/python
curl --data-binary "@$2" -X POST -H "Content-Type: text/plain" http://$1:8787
@jw910731
jw910731 / .vimrc
Last active August 9, 2019 11:51
Vim setting with vundle
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@jw910731
jw910731 / rgbled.cpp
Created August 20, 2019 07:57
Arduino RGB LED Library
#include "rgbled.h"
void rgbLed::off(){
emit(0,0,0);
}
void rgbLed::emit(int r, int g, int b){
r = safeAnalog(r);
g = safeAnalog(g);
b = safeAnalog(b);
if(common){
r = 255 - r;
@jw910731
jw910731 / bluetooth.cpp
Last active August 25, 2019 09:08
2019麗山FRC7589新生營藍牙接收模組
#include "bluetooth.h"
BluetoothHandler::BluetoothHandler(HardwareSerial *s, int baudRate):input(s), lSpd(0), rSpd(0), svoDeg(0), state(false){
input->begin(baudRate);
}
BluetoothHandler::BluetoothHandler(HardwareSerial *s){
BluetoothHandler(s, 9600);
}
void BluetoothHandler::receive(){
@jw910731
jw910731 / Judge.sh
Last active November 10, 2019 08:31
NPSC Test Script
#!/bin/bash
realpath(){
echo "$(cd "$(dirname "$1")"; pwd -P)/$(basename "$1")"
}
target="$(cd "$(dirname "$2")"; pwd -P)/$(basename "$2")"
pushd "$1" > /dev/null
BASE_DIR=/var/tmp/judge
if [[ -z "$1" ]]; then
echo argument not set or being blank
@jw910731
jw910731 / Judge.py
Created November 11, 2019 15:05
NPSC judge script
import os
import sys
import subprocess as subproc
import difflib
import decimal
from subprocess import PIPE
from typing import *
from argparse import ArgumentParser
def get_dirlist(parent_dir: str)-> List[str]:
@jw910731
jw910731 / autoRun.py
Last active April 13, 2020 14:46
Auto Run FFmpeg
import os
import sys
import subprocess
def list_dir(folder):
return [f for f in os.listdir(folder) if os.path.isfile(os.path.join(folder, f))]
class Runner(object):
def __init__(self, bin: str):
self.bin = bin

Keybase proof

I hereby claim:

  • I am jw910731 on github.
  • I am jw910731 (https://keybase.io/jw910731) on keybase.
  • I have a public key ASBd8wyibxuaogfpKwDcmu5Ltkt7eJ4wEBT7aATY9FblyAo

To claim this, I am signing this object: