Skip to content

Instantly share code, notes, and snippets.

View austintraver's full-sized avatar

Austin Traver austintraver

View GitHub Profile
#!/bin/zsh
# Check that the manpage exists
man -w $1 &> /dev/null
if [[ $? -ne 0 ]]; then
echo "No manual entry for $1" >&2
exit 1
fi
# base_folder='<base href="~/"\>'
# 1. Define a function, called "double", which doubles the number you give it
def double (x):
return (2 * x)
# 2. Set a variable called "output", make it {equal} to double of 4
y = 4
output = double (y)
# 3. Print that variable
# print (output)
#!/bin/zsh
counter=0
for row in {2..${LINES}}; do
((counter+=1))
# print -f '#'%.s {$((1+1))..$(($COLUMNS-1))}%
print -f '#'%.s {1..${COLUMNS}}
# (save) (left 1) (erase 1) (col 1) (erase 1) (return)
print -N '\x1b7' '\x1b[1D' '\x1b[X' '\x1b[1G' '\x1b[1X' '\x1b8' '\n'
done
Export[
"output.svg",
WolframAlpha[
"integrate 1/(1+cos(x)^2)",
{
{
"IndefiniteIntegral", 2
},
"Content"
},
@austintraver
austintraver / Professor.terminal
Created April 8, 2020 08:03
Professor Terminal Theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMS
AAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGjCwwTVSRudWxs0w0ODxARElVO
U1JHQlxOU0NvbG9yU3BhY2VWJGNsYXNzTxAoMC4wOTAxOTYwNzg0MyAwLjEwOTgwMzky
MTYgMC4xNDkwMTk2MDc4ABABgALSFBUWF1okY2xhc3NuYW1lWCRjbGFzc2VzV05TQ29s
const express = require('express')
const path = require('path')
const bodyParser = require('body-parser')
const app = express()
const router = express.Router()
const favicon = require('express-favicon')
const mongoose = require('mongoose')
const encrypt = require('mongoose-encryption')
// support parsing jsons
public class Server extends Thread {
private Socket clientSocket;
private BufferedReader fromClient;
private DataOutputStream toClient;
Server(Socket socket) {
this.clientSocket = socket;
}
public static void main (String args[]) throws Exception {
<<- EOF > basicquery.txt
Today's date is $(date)
The user ${USER} is on host ${HOST}
This program launched on ${TTY}
EOF
for domain in ${<(./domain_names.txt)}; {
print "Performing DNS query on ${domain}"
dig ${domain}
} > output.txt
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
public class Timer {
public static void main(String[] args) {
/* Get the current time */
LocalTime localTime = LocalTime.now();
@austintraver
austintraver / helper.py
Last active July 28, 2020 00:14
Grading script for CSCI 201 HW #2
from sys import argv
from subprocess import run
import datetime
import re
origin = None
index = 0
easy=[
0,
1.2,