Skip to content

Instantly share code, notes, and snippets.

@andrewjkerr
andrewjkerr / Instakitty.py
Created April 5, 2013 15:07
Generates ten pages of ten Instagram URLs that have a specific tag (in this case 'kitten'.) --- Uses python2.7!
'''
Created on Apr 4, 2013
@author: andrewjkerr
Shout out to kiks for the sweet Python lesson last night!
'''
import urllib2
import json
@andrewjkerr
andrewjkerr / DayOfTheWeek.py
Created April 12, 2013 00:38
Uses Zeller's congruence (found here: http://en.wikipedia.org/wiki/Zeller's_congruence) to figure out which day of the week that the date is! --- Uses python2.7!
'''
Created on Apr 11, 2013
@author: andrewkerr
'''
import math
input = raw_input("Enter your birthdate in a YYYY-MM-DD format:")
year = int(input[0:4])
@andrewjkerr
andrewjkerr / GradeCalculator.js
Last active January 31, 2021 09:43
A simple grade calculator script written in JavaScript along with the HTML form. The script uses the grading scale from my Marketing class, but you can change it to whatever is needed. Something important to note is that this grade calculator just adds everything up and uses a point scale. --- There's an implementation for my Marketing and Digit…
<script>
function setGrades() {
// Define those variables!
var quiz1 = parseFloat(document.getElementById('quiz1').value);
var quiz2 = parseFloat(document.getElementById('quiz2').value);
var quiz3 = parseFloat(document.getElementById('quiz3').value);
var quiz4 = parseFloat(document.getElementById('quiz4').value);
var quiz5 = parseFloat(document.getElementById('quiz5').value);
var quiz6 = parseFloat(document.getElementById('quiz6').value);
var quiz7 = parseFloat(document.getElementById('quiz7').value);
@andrewjkerr
andrewjkerr / json-parser-example.json
Last active December 16, 2015 03:19
This is a parsing example for the udp/json-parser which can be found here: (https://github.com/udp/json-parser.) This parser allows for easy parsing of a JSON file in C++. --- The sample JSON file is an example using the old Facebook Graph API
{
"data": [
{
"birthday": "01/01/2000",
"first_name": "John",
"last_name": "Doe",
"hometown": {
"name": "Tampa, Florida"
},
},
@andrewjkerr
andrewjkerr / searchingAndSorting.java
Last active December 16, 2015 03:19
A simple example of Selection Sort, Linear Search, and Binary Search. --- Originally for my Programming Fundamentals for CIS Majors 2 class at the University of Florida. The discussion instructions can be found here: http://www.cise.ufl.edu/class/cop3503fa12/discussion/disc11/ (as long as link stays live!)
import java.lang.Math;
import java.util.Arrays;
/**
* Discussion 11 COP 3503 Fall 2012
*
*/
public class SearchingAndSorting {
@andrewjkerr
andrewjkerr / businessDaysRemaining.js
Last active December 20, 2015 01:39
Uses the jQueryUI datepicker and the JavaScript date object to calculate the number of business days remaining between today and whatever date is picked with the datepicker.
$(function() {
$( "#datepicker" ).datepicker({
onSelect: function(){
// Gets the information from the picked date
var picked = $("#datepicker").datepicker('getDate');
var ddPicked = $("#datepicker").datepicker('getDate').getDate();
var mmPicked = $("#datepicker").datepicker('getDate').getMonth();
var yyyyPicked = $("#datepicker").datepicker('getDate').getFullYear();
var dotwPicked = $("#datepicker").datepicker('getDate').getDay();
@andrewjkerr
andrewjkerr / for-loops.c
Last active December 29, 2015 01:48
A few pointers on writing in C.
/*
* In C, you cannot do the following:
* for(int i = 0; i < 5; i++){
* // do stuff
* }
*
* You must do the following:
*/
void main( void ){
@andrewjkerr
andrewjkerr / microp-grade-update-checker.rb
Created December 3, 2013 18:37
Checks to see whether the grades for EEL4744c has been updated and emails TO@GMAIL.COM if it has :)
require 'net/http'
require 'net/smtp'
file = File.open("grades_current.html", "rb")
cur_source = file.read
message = <<MESSAGE_END
From: Andrew Kerr Updates <updates@andrewjkerr.com>
To: MicroP Peeps <microp@lists.ufl.edu>
Subject: MicroP Grades Updated!
@andrewjkerr
andrewjkerr / jquery-hide-and-show.js
Last active January 1, 2016 02:19
Click on div title and shows element right after title.
$(document).ready(function() {
$(".calc").hide();
//toggle the component with class msg_body
$(".className").click(function()
{
$(this).nextAll(".calc:first").slideToggle(500);
})
});
@andrewjkerr
andrewjkerr / winblows-remap.ahk
Last active January 4, 2016 09:08
Remaps alt and ctrl keys to make using Winblows less of a pain (this is for non OSX keyboards.)
LCtrl::LAlt
LAlt::LCtrl