Skip to content

Instantly share code, notes, and snippets.

View ProfAvery's full-sized avatar

Kenytt Avery ProfAvery

  • California State University, Fullerton
  • Fullerton, CA
View GitHub Profile
@ProfAvery
ProfAvery / ipsum.html
Created February 21, 2019 00:57
HTML for CSS Flexbox in-class exercise
<!DOCTYPE html>
<html lang="en">
<head>
<title>Lorem ipsum dolor sit amet</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css">
</head>
<body>
<header>
<h1>Ut enim ad minim veniam</h1>
</header>
@ProfAvery
ProfAvery / query.py
Last active April 27, 2022 20:35
Simple SQLite query utility that can print GUIDs
#!/usr/bin/env python
import cmd
import sys
import uuid
import pprint
import sqlite3
def make_dicts(cursor, row):
@ProfAvery
ProfAvery / tuffix-android.md
Created September 25, 2018 22:26
Android on Tuffix

Running the Android emulator on Tuffix

Note: these instructions are for a native installation of Tuffix. Do not run the emulator inside a Tuffix Virtual Machine.

  1. Install the following packages:
    $ sudo apt update

$ sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager

@ProfAvery
ProfAvery / TCPServer.py
Created September 24, 2018 04:26
Rewritten TCPServer.py to better show parallels with UDPServer.py
# TCPServer.py
#
# Compare to Kurose & Ross 7th Ed. pp. 168-169 and 163-164
#
from socket import *
serverPort = 12000
serverSocket = socket(AF_INET, SOCK_STREAM)
serverSocket.bind(('', serverPort))
serverSocket.listen(1)
@ProfAvery
ProfAvery / labtainer-reset.sh
Created September 24, 2018 04:06
Try to recover from issues with Labtainers by removing all containers and re-installing.
#!/bin/sh
# In case of Labtainer catastrophe, try this.
# Remove all containers:
for container in $(docker ps --all --quiet)
do
docker rm --force $container
done
# Update Labtainers just in case:
@ProfAvery
ProfAvery / emailapp.py
Created September 24, 2018 04:00
Simple SMTP client for CPSC 471 demo
# Simple Email client
#
# Hacked-up version of https://github.com/arka-nitd/send-email-gui.git
#
# To run a debugging SMTP server:
#
# $ python3 -m smtpd -n -d -c DebuggingServer
#
from tkinter import *
@ProfAvery
ProfAvery / <class>.c
Last active May 9, 2018 22:22
GObject Template
// <class>.c
#include "<class>.h"
typedef struct _<Class>Private <Class>Private;
G_DEFINE_TYPE(<Class>, <class>, G_TYPE_OBJECT)
#define <CLASS>(object) \
(G_TYPE_INSTANCE_GET_CLASS((object), TYPE_<CLASS>, <Class>))
@ProfAvery
ProfAvery / random-web-projects.py
Created April 19, 2018 03:58
Generate random dumb ideas for CPSC 473 projects
#!/usr/bin/env python
# Use Morphological Analysis to generate random project ideas
# See <https://guides.co/g/creativity/60958> for more information
import random
NPROJECTS = 100
projects = {
@ProfAvery
ProfAvery / .htmlhintrc
Last active June 4, 2017 05:16
.htmlhintrc to eliminate "Doctype must be declared first" errors in .hbs files
{
"doctype-first": false
}
@ProfAvery
ProfAvery / .eslintrc.js
Created April 18, 2017 03:36
ESLint configuration file for ES6
module.exports = {
"env": {
"node": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {