Skip to content

Instantly share code, notes, and snippets.

Avatar
🕵️‍♂️
Stay curious.

Eric Tendian EricTendian

🕵️‍♂️
Stay curious.
View GitHub Profile
@EricTendian
EricTendian / nuclear-waste-block-comment.txt
Created May 16, 2020
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
View nuclear-waste-block-comment.txt
/**
* 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 / email-over-curl.sh
Created Feb 17, 2020
Sending an HTML email with curl over SMTP
View email-over-curl.sh
#!/bin/bash
cat << EOF > email.eml
From: "${MAIL_FROM_NAME}" <${MAIL_FROM_ADDRESS}>
To: "${MAIL_TO_NAME}" <${MAIL_TO_ADDRESS}>
Reply-To: "${MAIL_TO_NAME}" <${MAIL_TO_ADDRESS}>
Subject: ${MAIL_SUBJECT}
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
@EricTendian
EricTendian / Instructions.md
Last active Nov 26, 2018 — forked from pgilad/Instructions.md
Git commit-msg hook to validate for jira issue or the word merge
View Instructions.md

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 / deploy-vagrant-azure.sh
Created May 30, 2017
How to deploy a Vagrant Linux box in Microsoft Azure with a custom image
View deploy-vagrant-azure.sh
# 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
View keybase.md

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 / remove_eggs.js
Created Apr 24, 2016
Simple script to remove egg accounts from your Twitter feed.
View remove_eggs.js
// 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;
@EricTendian
EricTendian / import_fb_chat_to_slack.js
Last active Aug 29, 2015
Use this little jQuery script to help create a CSV from a Facebook chat. You'll need to copy the ul element with id webMessengerRecentMessages and everything inside it to a new HTML file, and then include jQuery. From there you can open up devtools, paste in this script, and get an output. Then copy that output into a new textfile, save it, chan…
View import_fb_chat_to_slack.js
$("li.webMessengerMessageGroup > div.clearfix > div.clearfix._42ef").each(function () {
var line = '"'+Math.round($(this).find("div.rfloat._ohf abbr").attr("data-utime"))+'","general","'+$(this).find("div:nth-child(2) > strong > a").text()+'",';
$(this).find("div:nth-child(2) > div > div._53 > div").each(function () {
var text = $(this).find("div._38.direction_ltr > span > p").text().replace("\n","\\n");
if (text.length) console.log(line + '"'+text+ "\"\n");
});
});
@EricTendian
EricTendian / podcasts.md
Last active Feb 27, 2020
Podcasts I listen to (as of 2016)
View podcasts.md

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 / playzone.sh
Last active Aug 29, 2015
Use this shell script to play a specific Broadcastify #ChicagoScanner stream on your Linux computer. Currently uses omxplayer for use with a Raspberry Pi.
View playzone.sh
#!/bin/bash
case $1 in
'Chicago Police Department'|'cpd')
omxplayer http://relay.broadcastify.com:80/il_chicago_police2.mp3
;;
'Chicago Police - Citywide 1'|'cw1')
omxplayer http://relay.broadcastify.com:80/128024765.mp3
;;
'Chicago Police - Citywide 6'|'cw6')
@EricTendian
EricTendian / iitalert.php
Created Aug 26, 2014
A webhook for safety alert emails, built to work with the Illinois Institute of Technology's alert system. This script posts alert messages to a Facebook group as soon as the POST request is made.
View iitalert.php
<?php
/**
* IIT Alert notification app
* Created by: Eric Tendian
* This script is meant to be kicked off by cloudmailin.com upon a new email.
*
* Access token last generated: 25 August 2014
*
* To generate a new token, first visit the URL:
* https://graph.facebook.com/oauth/authorize?type=user_agent&client_id=[YOUR APP ID]&redirect_uri=[YOUR REDIRECT URL]&scope=user_groups,publish_actions