Skip to content

Instantly share code, notes, and snippets.

View EricTendian's full-sized avatar
🕵️‍♂️
Stay curious.

Eric Tendian EricTendian

🕵️‍♂️
Stay curious.
View GitHub Profile
@EricTendian
EricTendian / calcGrades-vector.cpp
Last active December 26, 2015 06:49
Reads a file called grades.txt with a list of grades, one on each line, and outputs the average of all the numbers, as well as the lowest and highest score. Uses vectors to account for an unlimited number of grades.
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
double findAvg(vector<double>);
double min_max(vector<double>, bool);
int main() {
vector<double> grades;
@EricTendian
EricTendian / ysradar.py
Last active January 3, 2016 18:09
Version 2.0 beta for use with YSFlight network version 20110207
#!/usr/bin/env python
from socket import *
from random import randrange
import sys, os, threading, re, math, time, urllib, string, struct
try: import psyco; psyco.full()
except: pass
@EricTendian
EricTendian / remove_eggs.js
Created April 24, 2016 03:56
Simple script to remove egg accounts from your Twitter feed.
// Works as of April 23, 2016 on Twitter.com and TweetDeck.twitter.com, in Google Chrome
/*
To use as a bookmarklet, bookmark this URL:
javascript:(function()%7Bvar%20eggs%20%3D%20document.querySelectorAll('.stream-item%20img%5Bsrc%5E%3D%22https%3A%2F%2Fabs.twimg.com%2Fsticky%2Fdefault_profile_images%2F%22%5D')%3Bfor%20(var%20i%20%3D%200%3B%20i%20%3C%20eggs.length%3B%20i%2B%2B)%20%7Bvar%20egg%20%3D%20eggs%5Bi%5D%3Bwhile%20(!egg.classList.contains(%22stream-item%22))%20%7Begg%20%3D%20egg.parentNode%3B%7Degg.remove()%3B%7D%7D)()
*/
var eggs = document.querySelectorAll('.stream-item img[src^="https://abs.twimg.com/sticky/default_profile_images/"]');
for (var i = 0; i < eggs.length; i++) {
var egg = eggs[i];
while (!egg.classList.contains("stream-item")) {
egg = egg.parentNode;

Keybase proof

I hereby claim:

  • I am EricTendian on github.
  • I am erictendian (https://keybase.io/erictendian) on keybase.
  • I have a public key whose fingerprint is 4A40 E547 DB36 E405 B2D8 A57B 34AC FA62 BE6B 7570

To claim this, I am signing this object:

@EricTendian
EricTendian / deploy-vagrant-azure.sh
Created May 30, 2017 02:37
How to deploy a Vagrant Linux box in Microsoft Azure with a custom image
# NOTE: This was tested on a Blackboard Learn Vagrant machine in May 2017. Unknown how well the directions apply to other Vagrant machines.
# NOTE 2: Errors WILL occur as this is not well supported on Azure. You may need to do a fair bit of troubleshooting and pay close attention to these instructions.
# Step 1: Download the Vagrant .box file
wget BOX_FILE
# Step 2: Extract the .box file to the current directory (check the file format with the `file` command before you use tar)
tar xf BOX_FILE
# Step 3: Convert the resulting VMDK to a fixed size VHD
VBoxManage clonehd box-disk1.vmdk --format VHD --variant Fixed box-disk1.vhd
# Step 4: Upload the VHD to a storage account of your choice
@EricTendian
EricTendian / favicon-colors
Created July 26, 2013 23:12
Nginx rewrite config for colored favicons, based on subdomain. If you have your dev. codebase, staging/qa. codebase, and your prod. codebase on the same server, you can give them different favicons to differentiate between the different branches. All subdomains that start with dev (such as dev.example.com and dev.app.example.com) would get the r…
location ~* /favicon(.*) {
log_not_found off;
access_log off;
root /var/www/default;
}
location = /favicon.ico {
if ($host ~* ^dev\.) {
rewrite ^/favicon\.ico$ /favicon-red.ico last;
}
if ($host ~* ^qa\.) {
@EricTendian
EricTendian / Instructions.md
Last active November 26, 2018 18:33 — forked from pgilad/Instructions.md
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • Copy the file commit-msg to .git/hooks/commit-msg
  • Make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

@EricTendian
EricTendian / podcasts.md
Last active February 27, 2020 06:27
Podcasts I listen to (as of 2016)

You'll have to search for these yourselves in the podcast app of your choice. I personally use the app "Stitcher". In no particular order...

Entrepreneurship

  • DFJ Entrepreneurial Thought Leaders
  • StartUp Podcast
  • a16z
  • This Week in Startups

News

@EricTendian
EricTendian / nuclear-waste-block-comment.txt
Created May 16, 2020 05:35
Use when needed to warn about nuclear waste-like code. From "Expert Judgment on Markers to Deter Inadvertent Human Intrusion into the Waste Isolation Pilot Plant", Sandia National Laboratories report SAND92-1382 / UC-721, p. F-49
/**
* This place is a message...and part of a
* system of messages...pay attention to it!
*
* Sending this message was important to us.
* We considered ourselves to be a powerful culture.
*
* This place is not a place of honor...no
* highly esteemed deed is commemorated here
* ...nothing valued is here.
@EricTendian
EricTendian / cpdZ4.html
Created February 5, 2023 19:01
Created March 17 2014
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Chicago Police Zone 4 - Dist 1 and 18 Live Audio Feed</title>
<script src="mediaelement/jquery.js"></script>
<script src="mediaelement/mediaelement-and-player.min.js"></script>
<link rel="stylesheet" href="mediaelement/mediaelementplayer.min.css" />
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />