Skip to content

Instantly share code, notes, and snippets.

View drpventura's full-sized avatar

Philip R. Ventura, Ph.D. drpventura

View GitHub Profile
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
# Sensitive or high-churn files:
.idea/**/dataSources/
@drpventura
drpventura / span-div.html
Last active February 5, 2017 19:06
span-div.html see video at: https://youtu.be/l37meK4syiA
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Span vs. Div</title>
</head>
<body>
<h1>Span vs. Div</h1>
<p>Here is a span tag, <span>this content is spanned.</span></p>
<p>Here is a div <div>This is in a div.</div>
@drpventura
drpventura / more.html
Last active February 6, 2017 16:36
more.html see video at: https://youtu.be/l37meK4syiA
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>More HTML</title>
</head>
<body>
<h1>More HTML</h1>
<nav>
@drpventura
drpventura / teaching.sql
Last active January 28, 2019 01:36
The teaching table creation and CSV file importation into MariaDB (MySQL) shown in the video at: https://youtu.be/smJFdYnphVk
use first;
create table teaching (
instr_name varchar(15),
course varchar(10)
);
-- NOTE: You will need to update the path to match where instr-classes.csv is.
load data local infile 'D:/Users/Phil/Downloads/instr-classes.csv'
into table teaching
fields terminated by ',';
@drpventura
drpventura / first.sql
Last active February 1, 2017 06:15
MariaDB (MySQL) export file of our first database. See video at: https://youtu.be/smJFdYnphVk
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Feb 01, 2017 at 05:45 AM
-- Server version: 10.1.19-MariaDB
-- PHP Version: 5.6.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
1,YOU CAN'T DATE COPS!,"It's not like the police are gonna catch you, you've taken care of that, it's just that you don't feel like yourself around cops. You get all stiff and become way less outgoing, so how can that lead to a fun date?"
2,THE GNAWING GUILT,"The guilt keeps you awake for hours, you toss and turn thinking of the victim's family, berating yourself for going too far, and wishing you could take it back. But you can't."
3,"""NEVER HAVE I EVER"" ISN'T FUN ANYMORE!",It's basically impossible to get excited about your friends' petty infractions after you've murdered someone in cold blood. So what's the point of even playing?
4,THE FEAR THAT YOU MIGHT KILL AGAIN,"Now that you know you're capable of killing, you find yourself thinking of murder as a solution to anything-- from a friend's betrayal, to a long line at CVS. It's a scary to realize that you are dangerous and not completely in control."
5,TOO MUCH LEFT OVER LYE!,"They sell it in 1 gallon tubs, but you only need 1/4 of a gallon to decompose
@drpventura
drpventura / instr-classes.csv
Last active January 28, 2019 01:37
A very simple Comma Separated Value file. See video at: https://youtu.be/smJFdYnphVk
Instructor Name Course
Ventura CGS 1540
Small COP 2512
Gaspar COP 2513
@drpventura
drpventura / FileStringsEx.java
Last active January 22, 2017 04:35
Example of using Scanner for I/O from stdin, and files as well as manipulating strings, see video at https://youtu.be/urNqQcqiUTE
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class FileStringsEx {
public static boolean hasComment(String s) {
return s.indexOf("(*") != -1 && s.indexOf("*)") != -1;
}
public static void main(String[] args) throws FileNotFoundException {
@drpventura
drpventura / Benford.java
Created January 19, 2017 01:32
Simple file access using Scanner
package edu.usf;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Benford {
public static void main(String[] args) throws FileNotFoundException {
Scanner s = new Scanner(new File("data/sample1.txt"));
@drpventura
drpventura / handler.clj
Created December 6, 2016 03:25
Example for figuring out how file upload works.
(ns file-upload.handler
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.defaults :refer [wrap-defaults site-defaults]]
[ring.middleware.params :refer [wrap-params]]
[ring.middleware.multipart-params :refer [wrap-multipart-params]]
[ring.middleware.reload :refer [wrap-reload]]
[ring.adapter.jetty :refer [run-jetty]]
[hiccup.core :refer [html]]))