Skip to content

Instantly share code, notes, and snippets.

View pianomanfrazier's full-sized avatar

Pianomanfrazier pianomanfrazier

View GitHub Profile
@pianomanfrazier
pianomanfrazier / fact.rs
Last active January 1, 2019 23:48
A factorial test in Rust
use std::cmp::Ordering;
use std::io;
const ONE: u64 = 1;
fn main() {
loop {
let mut guess = String::new();
io::stdin()
# add this to your bashrc to generate a weekly git report
# useage: $ report
alias report='git log --branches=* --pretty=format:"%ad - %an: %s" --after=$(date +%Y-%m-%d -d "-9 day") --until=$(date +%Y-%m-%d) --author="YOUR NAME"'
@pianomanfrazier
pianomanfrazier / README.md
Last active October 12, 2018 16:42
A simple JSON Flask test

Run the app as follows:

# install flask and requests
virtualenv venv -p python3
source ./venv/bin/activate
pip install flask requests
FLASK_APP=app.py FLASK_DEBUG=1 flask run
@pianomanfrazier
pianomanfrazier / i3-config.txt
Created August 26, 2018 04:11
My i3 config for my laptop
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@pianomanfrazier
pianomanfrazier / vscode_settings.json
Last active August 21, 2018 02:44
My vscode settings
{
"vim.disableAnnoyingNeovimMessage": true,
"files.associations": {
"*.mmark":"markdown"
},
"extensions.ignoreRecommendations": false,
"window.zoomLevel": 1,
"emmet.syntaxProfiles": {
"javascript": "vue"
},
@pianomanfrazier
pianomanfrazier / search.py
Last active August 16, 2018 22:07
Fuzzy search openstorefront permissions (run on WSL)
#!./venv/bin/python
import os, sys, glob, re
from fuzzywuzzy import fuzz
LOWER = 60
UPPER = 99
pattern = re.compile(r'".+?"|\'.+?\'')
permFile = "/mnt/c/dev/openstorefront/server/openstorefront/openstorefront-core/model/src/main/java/edu/usu/sdl/openstorefront/core/entity/SecurityPermission.java"
rootDir = "/mnt/c/dev/openstorefront/server/openstorefront"
#!/bin/bash
#By Dave Newton from SmashingMagazine article
#This function is from https://www.smashingmagazine.com/2015/06/efficient-image-resizing-with-imagemagick/
#I am puting this here so I can find it when I need it. Super helpful for web image resizing.
#
# usage:
# smartresize inputfile.png 300 outputdir/
smartresize() {
@pianomanfrazier
pianomanfrazier / tikz_doodle.tex
Created September 27, 2017 01:16
Some Tikz and tikz-er2 doodles for Latex
\documentclass[12pt, letterpaper]{article}
\usepackage{fontspec}
\usepackage{tikz-er2}
\usetikzlibrary{positioning}
\begin{document}
\begin{figure}[h!]
\begin{center}
\begin{tikzpicture}[node distance=2cm]
\node[entity] (emp) {Employee};
-- This is a set of data to use with USU CS5800 Homework 1, Relational Algebra
group: HomeWork1
Supplier = {
Name:string, City:string
'Amazon', 'Seattle'
'Google', 'Ventura'
'Disney', 'Anaheim'