Skip to content

Instantly share code, notes, and snippets.

View chtzvt's full-sized avatar
🌻
‍To create a little flower is the labor of ages.

Charlton Trezevant chtzvt

🌻
‍To create a little flower is the labor of ages.
View GitHub Profile
@chtzvt
chtzvt / .bash_profile
Created March 12, 2016 23:00
Sick, informational bash profile: https://imgur.com/g1Nym7r
#!/usr/bin/env bash
# Calculate uptime days/hrs/mins/secs
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
let secs=$((${upSeconds}%60))
let mins=$((${upSeconds}/60%60))
let hours=$((${upSeconds}/3600%24))
let days=$((${upSeconds}/86400))
UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"`
@chtzvt
chtzvt / GPMDP Update Spoof
Last active September 19, 2017 17:16
GPMDP update server spoofing
$HTTP["host"] =~ "update.googleplaymusicdesktopplayer.com" {
server.document-root = "/var/www/hosts/gpmdp/"
$HTTP["url"] =~ "^/update/osx/"{
server.document-root = "/var/www/hosts/gpmdp/fake.json"
}
$HTTP["url"] == "/"{
@chtzvt
chtzvt / bigguy.js
Created April 25, 2016 21:07
Web-friendly reimplementation of https://gist.github.com/ctrezevant/175d098088b71b823450, because I hate the world
// BANEPOST.JS: FOR BIG GUYS
// By Charlton Trezevant
// Responses.
var uuuu = [ "You're a big guy.", "He didn't fly so well", "...for you.", "TELL ME ABOUT BANE. WHY DOES HE WEAR THE MASK?",
"The flight plan I just filed with the agency lists me, my men, Dr.Pavel here, but only ONE of YOU!", "Dr.Pavel, I'm CIA.", "The masked man 0_0",
"Nobody cared who I was 'til I put on the mask.", "If I pull that off will you die?", "Crashing this plane, WITH NO SURVIVORS.",
"Was getting caught part of your plan?", "He wasn't alone.", "You don't get to bring friends.", "Don't worry, no charge for them.",
"Get 'em on board - I'll call it in.", "FIRST ONE TO TALK GETS TO STAY ON MY AIRCRAFT.", "HE DIDN'T FLY SO GOOD! WHO WANTS TO TRY NEXT?!",
"LOT OF LOYALTY FOR A HIRED GUN!", "Or perhaps he's wondering why someone would shoot a man before throwing him out of a plane?",
@chtzvt
chtzvt / spongegar.js
Last active June 1, 2016 02:56
This is what runs @_spongegar
var CONFIG = {
BOT_NAME: '_spongegar',
MEDIA_ID: '737763742998355968',
TWITTER_API_KEYS: {
consumer_key: ' ',
consumer_secret: ' ',
access_token: ' ',
access_token_secret: ' ',
}
}
@chtzvt
chtzvt / flac_mp3.sh
Last active July 24, 2016 18:08
Convert all FLAC files in the current directory to 320kbps MP3, preserving ID3 tags (aka track metadata)
find . -name "*.flac" -exec avconv -i {} -ab 320k -map_metadata 0 -id3v2_version 3 {}.mp3 \;
@chtzvt
chtzvt / doorMan_bot.js
Last active July 22, 2016 22:52
Twitter bot to control your garage door using the Doorman API.
// Moved to https://github.com/ctrezevant/doorMan/blob/master/DoorMan_twitterBot.js
@chtzvt
chtzvt / shitmemes.js
Last active September 4, 2016 01:30
Automatically reply to Twitter direct messages with terrible memes
var CONFIG = {
BOT_NAME: ' ',
TWITTER_API_KEYS: {
consumer_key: ' ',
consumer_secret: ' ',
access_token: ' ',
access_token_secret: ' ',
},
IMGUR_CLIENT_ID: ' ',
GIPHY_API_KEY: 'dc6zaTOxFJmzC', // Giphy's default public API key, from their wiki
@chtzvt
chtzvt / cleverbot_twitter.js
Last active January 27, 2018 10:52
Let cleverbot.io manage your Twitter DMs for you
var CONFIG = {
BOT_NAME: ' ',
TWITTER_API_KEYS: {
consumer_key: ' ',
consumer_secret: ' ',
access_token: ' ',
access_token_secret: ' ',
},
CLEVERBOTIO_API_USER: ' ',
CLEVERBOTIO_API_KEY: ' ',
import numpy as np
import matplotlib.pyplot as plt
xax = np.array([1.7,7.7,18.8,27.2,34.5,37.5,37.8,38.1,36.8,35.7,34.9])
yax = np.array(["0-9","10-19","20-29","30-39","40-49","50-59","60-69","70-79","80-89","90-99","100-109"])
values, base = np.histogram(xax, bins=10)
cum = np.cumsum(values)
yax_arrange = y_axis = np.arange(1, len(yax) + 1, 1)
@chtzvt
chtzvt / cheerlights.html
Created September 3, 2016 21:25
Displays the latest Cheerlights color in your web browser
<head>
<!--
Cheerlights for the Web.
Created by Charlton Trezevant (2016), MIT License
What is Cheerlights? See http://cheerlights.com
Live Demo: http://cheerlights.ctis.me
-->
<title>Cheerlights</title>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://code.jquery.com/color/jquery.color-2.1.2.min.js"></script>