Skip to content

Instantly share code, notes, and snippets.

@RyanFleck
RyanFleck / elg_plot_csvs.py
Created February 11, 2020 17:40
Given a folder of CSV files, return a .png for each with the plotted values.
import numpy as np
import matplotlib.pyplot as plt
import csv
import glob
import os
print("Gathering CSVs...")
csvFiles = sorted(glob.glob(os.getcwd() + "/*.csv"))
numpyFileData = []
import random
while(True):
x = input(">>> ")
x = list(x)
y = []
for char in x:
if char == " ":
y.append(" ")
else:
--- CEG3155 Lab 2 material.
library IEEE;
use IEEE.Std_Logic_1164.all;
entity halfadder is
port (
A, B : in std_logic;
sum, carry : out std_logic
);
/*
Ryan Fleck
Interrupt Programming Tests
*/
// Light for testing feedback.
const byte ledPIN = 13;
// Interrupt pin zero is digital pin 2.
const byte interruptPIN = 2;
@RyanFleck
RyanFleck / Interrupt.ino
Last active September 21, 2019 21:39
Simple Interrupt
// Pin 13 has an LED connected on most Arduino boards.
const byte ledPIN = 13;
const byte interruptPIN = 2;
volatile boolean enabled;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(ledPIN, OUTPUT);
pinMode(interruptPIN, INPUT_PULLUP);
title author
The Zen of Vim
Ryan Fleck

When is a tool more than a tool?

When does a hammer transcend its ability simply to hammer nails, but becomes an extension of the workman's body, a physical manifestation of his will?

When does the swordsman's sword feel, sense and touch as the swordsman's own hands would? To taste the slow drip of hot liquid and the texture of the fabric it cuts?

@RyanFleck
RyanFleck / loc.py
Created July 10, 2019 15:01
Count lines of code for a given extension type in a repository.
#!/usr/bin/python3
# Takes file extension as first argument, counts lines of code.
import os
import sys
import re
def countLinesOfCode(extension):
print(r'(.*\.{}$)'.format(extension))
@RyanFleck
RyanFleck / simplicity.html
Created July 8, 2019 14:05
Minimalist web design for an article.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Simplicity-1</title>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width,initial-scale=1,shrink-to-fit=no"
/>
<style>
# Some useful OSX aliases for your .zshrc or .bash_aliases
alias np='Open /Applications/TextEdit.app' # Open the notepad for easier copy-pasting from terminal.
alias py='python3'
alias pyp='pip3'
alias pep8='autopep8 -i -a -a -a'
alias sp='python3 ~/RCF/sp.py'
#!/usr/bin/python3
import os
def crawlAndPullRepos():
issue_dirs = []
for dirname, subdirs, filenames in os.walk(os.getcwd()):
if '.git' in subdirs:
print("\nDirectory " + dirname + " is a git repository.")
output = os.system("cd " + dirname + " && git pull")