Skip to content

Instantly share code, notes, and snippets.

View battis's full-sized avatar

Seth Battis battis

View GitHub Profile
<h2>Glossary of Vocabulary</h2>
<h3>Programming</h3>
<div style="background: #dfd;">
<h5>Compiler</h5>
<h5>High-Level Language</h5>
<h5>IDE</h5>
<h5>Interpreter</h5>
<h5>Low-Level Language</h5>
<h5>Source Code</h5>
<h5>Text Editor</h5>
<html><body><pre>
<?php
require_once('.ignore.canvas-authentication.inc.php');
require_once('Pest.php');
/**
* Generate the Canvas API authorization header
**/
function buildCanvasAuthorizationHeader() {
@battis
battis / MyNiftyProgram.java
Created November 8, 2013 12:44
Pseudocode Example
/**
* A brief (but complete) high-level description of the function and purpose
* of the class, included as Javadoc documentation for each class.
*
* @author Seth Battis
*
*/
public class MyNiftyProgram {
/**
// https://www.facebook.com/david.salmanson.9/posts/10203810541089037
package net.battis.IndianRunMusicalChairs;
import java.util.*;
public class IndianRunMusicalChairs {
private ArrayList<Integer> players;
private boolean justSatDown = true;
@battis
battis / commit-www-to-github.sh
Last active August 29, 2015 14:05
A handy little shell script to schedule with crontab to regularly commit the latest version of a web server to Github.
#!/bin/bash
logfile=/var/www/git.log
exec >> $logfile 2>&1
date +"%Y-%m-%d %r"
cd /var/www
git fetch -q origin
git merge origin/master
git submodule update --recursive
git add -A .
git commit -q -m 'Auto Backup'
@battis
battis / single-menu.js
Last active August 29, 2015 14:09
Single Entry Resource Menu
// define your menu here
var resources = {
// menu title
// can also have a url property, so clicking the menu title sends you somewhere
// can also have a target property, so clicking the menu title opens in a specific frame/window/tab
title: 'Library',
url: 'http://library.stmarksschool.org',
columns: []
};
@battis
battis / emoji.php
Last active October 5, 2021 20:15
Trying to store/retrieve/display Unicode emoji in a MySQL database
<?php
// MySQL schema
/*
CREATE TABLE `test` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`text` text,
`blob` blob,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
@battis
battis / .gitignore
Last active October 8, 2015 18:54
Minimal Eclipse Mars JDT .gitignore
######################################################################
# Minimal Eclipse Mars JDT
#
# https://gist.github.com/battis/f9adaebfab50c0d5bcb0
#
# Capture projects and user library configuration, but nothing else
# ignore Eclipse metadata
.metadata/*
!.metadata/.plugins
@battis
battis / .block
Last active July 1, 2016 12:47
Arbitrary RGB with Desmos API
license: gpl-3.0
@battis
battis / hide-calendar.js
Last active August 24, 2016 02:14
Hide arbitrary course calendar in Canvas
/* imagine we want to remove course ID 863 from the calendar list */
var id = 863;
/* look to see if that calendar is currently enabled */
if ($('#context-list li[data-context="course_' + id + '"] checked').length != 0) {
/* click toggle box to hide (a persistent setting -- should only happen once) */
$('#context-list li[data-context="course_' + id + '"] .context-list-toggle-box').click();
}
/* hide calendar so that it can't be re-enabled -- and won't count against limit of 10 */