Skip to content

Instantly share code, notes, and snippets.

View claymcleod's full-sized avatar
🧬

Clay McLeod claymcleod

🧬
View GitHub Profile
--[[ Arithmetic Expression Tree Program Skeleton
Recursive Function Version with Record-style Nodes
H. Conrad Cunningham, Professor
Computer and Information Science
University of Mississippi
Developed for CSci 658, Software Language Engineering, Fall 2013
1234567890123456789012345678901234567890123456789012345678901234567890
{- CSci 450/503, Fall 2014
Homework #4: Sandwich DSL
Clay McLeod
5 November 2014
This is the SandwichDSL base code from the case study. It can be
expanded to build the module for Assignment #4.
-}
@claymcleod
claymcleod / mine_reddit.rb
Last active March 11, 2019 22:25
Simple ruby datamining example
# Title: Simple Ruby Datamining Example
# Authors: Clay McLeod
# Description: Mines data every minute concerning how many people are logged into a certain subreddit.
# Section: Ruby
# Subsection: Data Science
require 'csv'
require 'rubygems'
require 'nokogiri'
require 'rest-client'
// Title: Lazy Initialization of Swift Variables
// Authors: Clay McLeod
// Description: An example of how to create a variable using lazy initialization
// in the Swift programming language.
// Section: Swift
// Subsection: Variables
import UIKit
lazy var _animator : UIDynamicAnimator! = {
// Title: Listening for Tap Gestures
// Authors: Clay McLeod
// Description: How to handle tap gestures on a view controller.
// Section: Swift
// Subsection: UI
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
# Title: Regular Expressions with Python
# Authors: Clay McLeod
# Description: Shows you how to find all instances of a regular expression
# in a string
# Section: Python
# Subsection: General
#
# Python docs on Regex: https://docs.python.org/2/howto/regex.html
#
# Notes:
// Title: Regular Expressions with Swift
// Authors: Clay McLeod
// Description: A brief overview of regular expressions with Swift
// Section: Swift
// Subsection: General
import Foundation
var error: NSError?
let pattern = "[A-Za-z]atch"
// Title: UIDynamics
// Authors: Clay McLeod
// Description: A brief overview of UIDynamics in iOS 8
// Section: Swift
// Subsection: UI
//
// Note: Please disable all but portrait orientation!
import UIKit
import CoreMotion
# Title: Randomized Algorithm (Median)
# Authors: Clay McLeod
# Description: A randomized algorithm for finding the median of an array.
# Section: Python
# Subsection: Interesting Problems
import sys
import math
import random
@claymcleod
claymcleod / ubuntu_compile_kernel.sh
Last active September 29, 2017 17:13
Compiling the current ubuntu kernel
# Get kernel source
apt-get source linux-image-$(uname -r)
# Download kernel build tools
sudo apt-get install libncurses5-dev kernel-package
sudo apt-get build-dep linux-image-$(uname -r)
# Change the directory to the Linux source directory
cd /usr/src/linux-.....