Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am brandonlou on github.
  • I am brlou (https://keybase.io/brlou) on keybase.
  • I have a public key ASALQiP7WHsu2dDlePywLTHWszo3OMbK3hTE7mmc81KtGwo

To claim this, I am signing this object:

@brandonlou
brandonlou / keep_exe.py
Last active May 18, 2022 21:50
Keep only exe files in a directory
import argparse
import filetype
import os
def main():
parser = argparse.ArgumentParser(description='Keep all exe files in a directory and remove the rest')
parser.add_argument('directory')
args = parser.parse_args()
import cirq
from qiskit import IBMQ, execute, QuantumCircuit
IBMQ.save_account('API_TOKEN') # Make a IBMQ account and copy your API token here.
provider = IBMQ.load_account()
backend = provider.backend.ibmq_athens # Change as necessary.
circuit = cirq.Circuit()
# Create your cirq circuit here.
@brandonlou
brandonlou / autocopypaste.py
Created August 4, 2020 23:26
Reads and copies a file line by line whenever a user pastes.
#!/usr/bin/env python3
import sys
import pyperclip
import platform
from pynput import keyboard
# Paste key combination
if platform.system() == 'Darwin': # Mac
COMBINATION = {keyboard.Key.cmd, keyboard.KeyCode(char='v')}
@brandonlou
brandonlou / open_users.sh
Last active August 11, 2020 04:20
Check for available usernames
#!/bin/bash
# Check at least one argument is passed.
if [ $# -eq 0 ]
then
echo "Usage: ./open-users.sh [website URL]"
exit 1
fi
URL=$1
@brandonlou
brandonlou / GripPipeline.java
Created April 5, 2018 04:28
OpenCV + GRIP Test
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.HashMap;
import edu.wpi.first.wpilibj.vision.VisionPipeline;