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 / info.cpp
Created September 9, 2020 06:45
In-class Exercise: Linux Programmer's Manual
#include <cstdlib>
#include <iostream>
#include <sys/utsname.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
using std::cout;
using std::endl;
@ProfAvery
ProfAvery / logging.ini
Created June 20, 2020 09:18
Simple logging configuration for Python
#
# Simple logging configuration for Python
#
# NOTE: Don't add spaces between comma-separated lists in this file
#
[DEFAULT]
filename = 'output.log'
[loggers]
@ProfAvery
ProfAvery / config1.py
Created April 8, 2020 14:16
Flask-Dynamo configuration fixes
app.config['DYNAMO_TABLES'] = [
dict(
TableName='users',
KeySchema=[dict(AttributeName='username', KeyType='HASH')],
AttributeDefinitions=[dict(AttributeName='username', AttributeType='S')],
ProvisionedThroughput=dict(ReadCapacityUnits=5, WriteCapacityUnits=5)
), dict(
TableName='groups',
KeySchema=[dict(AttributeName='name', KeyType='HASH')],
AttributeDefinitions=[dict(AttributeName='name', AttributeType='S')],
@ProfAvery
ProfAvery / data.csv
Last active February 14, 2020 01:27
Skeleton code for in-class exercise
1 6
2 6
3 10
4 12
@ProfAvery
ProfAvery / hebb.py
Last active February 10, 2020 02:26
Hebb Net example - Character recognition
#!/usr/bin/env python3
# Hebb Net example - Character recognition
#
# See Fausett, Example 2.8, pp. 55-56
#
TRAINING_X = [
'#...#',
'.#.#.',
@ProfAvery
ProfAvery / allow_nil.rb
Created September 26, 2019 06:51
Allow nil to be passed to and from Ruby XML-RPC servers
require 'xmlrpc/server'
def suppress_warnings
previous_VERBOSE, $VERBOSE = $VERBOSE, nil
yield
$VERBOSE = previous_VERBOSE
end
suppress_warnings do
XMLRPC::Config::ENABLE_NIL_PARSER = true
let fractionCodes = {
189: "1/2",
8531: "1/3",
8532: "2/3",
188: "1/4",
190: "3/4",
8533: "1/5"
}; //fill in the rest from unicodefractions.com
function removeFractions(s) {
@ProfAvery
ProfAvery / test.js
Created March 3, 2019 06:29
Test file for ESLint
/*
*
* kda@bender:~/work/cpsc349$ eslint test.js
*
* /home/kda/work/cpsc349/test.js
* 18:15 error Missing space before function parentheses space-before-function-paren
* 19:1 error Expected indentation of 2 spaces but found 4 indent
* 19:27 error Missing semicolon semi
* 22:14 error Strings must use singlequote quotes
* 23:1 error 'greeting' is not defined no-undef
@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):