Skip to content

Instantly share code, notes, and snippets.

View zacharyneveu's full-sized avatar

Zachary Neveu zacharyneveu

View GitHub Profile
@zacharyneveu
zacharyneveu / cosine.cpp
Last active March 19, 2017 21:42
Calculates cosine using series expansion
//This program gets an angle in radians and calculates its cosine using series expansion.
#include<iostream>
#include<cmath>
using namespace std;
//declare variables and functions here
double angle;
double cosx=1;
//cosine function uses first five terms of series expansion to return the approximate cosine of an angle.
//fact function computes factorial as seen in class.
@zacharyneveu
zacharyneveu / drawio-allpages.py
Last active May 10, 2019 18:09
Python Script to convert each page of a drawio file to a png image with the page name as the file name. Requires https://github.com/languitar/drawio-batch to be installed
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Runs drawio-batch for all pages of drawio file
"""
import sys, os
xsl="""<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
@zacharyneveu
zacharyneveu / gruvbox.css
Last active November 4, 2020 11:43
Gruvbox colors as css variables
:root {
--gb-dark0_hard :#1d2021;
--gb-dark0 :#282828;
--gb-dark0_soft :#32302f;
--gb-dark1 :#3c3836;
--gb-dark2 :#504945;
--gb-dark3 :#665c54;
--gb-dark4 :#7c6f64;
--gb-dark4_256 :#7c6f64;
--gb-gray_245 :#928374;
We can't make this file beautiful and searchable because it's too large.
part,company,country,city,price,date
54868-5165,Chatterbridge,Spain,Barcelona,784.79€,2016-01-02 00:01:05
60505-2867,Lajo,Greece,Thessaloniki,187.99€,2016-01-02 00:05:26
24385-268,Flipstorm,Greece,Athens,221.73€,2016-01-02 00:18:30
76117-001,Twitterbeat,France,Annecy,1075.82€,2016-01-02 02:32:30
44946-1046,Chatterbridge,Spain,Barcelona,412.55€,2016-01-02 04:51:55
16729-167,Chatterbridge,Spain,Barcelona,359.52€,2016-01-02 07:20:59
52125-444,Voomm,France,Paris,266.62€,2016-01-02 07:40:37
43419-018,Buzzbean,Germany,Düsseldorf,103.45€,2016-01-02 08:57:57
54092-515,Zooxo,United Kingdom,London,£704.94,2016-01-02 09:09:01
{"success": true, "timestamp": 1570023547, "base": "EUR", "date": "2019-10-02", "rates": {"AED": 4.019391, "AFN": 85.563569, "ALL": 122.594044, "AMD": 520.216737, "ANG": 1.916905, "AOA": 413.657877, "ARS": 63.328435, "AUD": 1.635627, "AWG": 1.969646, "AZN": 1.865687, "BAM": 1.956022, "BBD": 2.205347, "BDT": 92.286715, "BGN": 1.956132, "BHD": 0.412543, "BIF": 2035.300563, "BMD": 1.094248, "BND": 1.513727, "BOB": 7.552605, "BRL": 4.549229, "BSD": 1.092267, "BTC": 0.000132, "BTN": 77.660994, "BWP": 12.135755, "BYN": 2.281399, "BYR": 21447.253246, "BZD": 2.201601, "CAD": 1.45286, "CDF": 1823.016899, "CHF": 1.093219, "CLF": 0.028925, "CLP": 798.037177, "CNY": 7.822124, "COP": 3814.547184, "CRC": 634.483052, "CUC": 1.094248, "CUP": 28.997562, "CVE": 110.289418, "CZK": 25.789115, "DJF": 194.46974, "DKK": 7.466486, "DOP": 56.98293, "DZD": 131.938882, "EGP": 17.845753, "ERN": 16.413503, "ETB": 32.149548, "EUR": 1, "FJD": 2.405539, "FKP": 0.889492, "GBP": 0.891412, "GEL": 3.266318, "GGP": 0.891463, "GHS": 5.886998, "GI
{
"name": "Gruvbox",
"cursorColor": "#928374",
"selectionBackground": "#504945",
"background": "#282828",
"foreground": "#ebdbb2",
"black": "#282828",
@zacharyneveu
zacharyneveu / nice_shell_things.sh
Created May 30, 2024 16:47
Add nice things to Ubuntu terminal - useful for new docker containers, EC2 boxes, etc.
#!/usr/bin/env bash
# Oh my ZSH
sudo apt install -y zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Ranger file manager
sudo apt install -y ranger
echo 'alias r=". ranger"' >> ~/.zshrc
@zacharyneveu
zacharyneveu / merge-and-export-gps.sh
Created June 11, 2024 12:22
Combine all GoPro videos in a folder into a single file and export GPS metadata to a separate GPX file.
#! /bin/sh
#
# merge-and-export-gps.sh
# Copyright (C) 2023 zach <zach@Zach-Desktop>
#
# Distributed under terms of the MIT license.
#
#! /bin/sh
#
# merge-and-export-gps.sh