Skip to content

Instantly share code, notes, and snippets.

View csabatini's full-sized avatar

Caleb Sabatini csabatini

View GitHub Profile
@csabatini
csabatini / sample_gitignore.txt
Created December 15, 2021 15:57
Sample gitignore
# built application files
*.apk
*.ap_
# build system
.gradle
/build
# files for the dex VM
*.dex
@csabatini
csabatini / kbai_notes.txt
Last active September 7, 2024 19:00
OMSCS KBAI Notes
Ebook: https://gatech.instructure.com/courses/193244/files/folder/KBAI-Ebook
GDrive notes #1: https://drive.google.com/file/d/1T2TNnNQbfkjR1kyiwC3hgLEjTFiMgbC5/view
GDrive notes #2: https://drive.google.com/drive/folders/1f-udSsv9oMgJ8zzP_YuJo2Em0zQgrDuC?usp=sharing
---
Lesson 3: Semantic Networks
1. Knowledge representation and Reasoning using that representation is the key to problem-solving. 2. Semantic Networks are one of the many ways for knowledge representation. 3. Pathways along spreading activation networks could potentially help with memorizing and recalling solutions instead of solving them every time for new recurring problems.
---
#!/bin/bash
####
# Split MySQL dump SQL file into one file per table
# based on http://blog.tty.nl/2011/12/28/splitting-a-database-dump
####
if [ $# -lt 1 ] ; then
echo "USAGE $0 DUMP_FILE [TABLE]"
exit
#!/bin/sh
case "$1" in
*.awk|*.groff|*.java|*.js|*.m4|*.php|*.pl|*.pm|*.pod|*.sh|\
*.ad[asb]|*.asm|*.inc|*.[ch]|*.[ch]pp|*.[ch]xx|*.cc|*.hh|\
*.lsp|*.l|*.pas|*.p|*.xml|*.xps|*.xsl|*.axp|*.ppd|*.pov|\
*.diff|*.patch|*.py|*.rb|*.sql|*.ebuild|*.eclass)
pygmentize -f 256 "$1";;
.bashrc|.bash_aliases|.bash_environment)
pygmentize -f 256 -l sh "$1"
;;
from sqlalchemy import *
engine = \
create_engine("postgresql://...@localhost:5432/nfldb")
metadata = MetaData(bind=engine)
teams = Table('team', metadata, autoload=True)
players = Table('player', metadata, autoload=True)
inputname = input('input a player name:')
@csabatini
csabatini / sqlalchemy_reflect.py
Created December 4, 2017 03:29
Auto-create models from an existing db with SQLAlchemy
from __future__ import print_function
from sqlalchemy import *
from sqlalchemy.orm import create_session
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
engine = \
create_engine("postgresql://...")
metadata = MetaData(bind=engine)
import os
from datetime import datetime
directory = './test'
for filename in os.listdir(directory):
filepath = directory + '/' + filename
filestats = os.stat(filepath)
print '{} - {} - {} - {}'.format(
filepath, filestats.st_size, datetime.fromtimestamp(os.path.getctime(filepath)), datetime.fromtimestamp(os.path.getmtime(filepath))
@csabatini
csabatini / download_service.py
Created August 3, 2017 20:50
Tiny Flask web service for triggering S3 downloads
from flask import Flask, request, abort
import boto3
import json
import os
app = Flask(__name__)
s3client = boto3.client('s3')
@app.route('/', methods=['GET'])
def index():
@csabatini
csabatini / nginx_redirect.conf
Created May 8, 2017 15:27
nginx - redirect HTTP to HTTPS
server {
listen 80;
server_name mydomain.com;
return 301 https://$server_name$request_uri;
}