Skip to content

Instantly share code, notes, and snippets.

View rye's full-sized avatar
🦀
wranglin' Cow<T>'s

Kris Rye rye

🦀
wranglin' Cow<T>'s
View GitHub Profile
@rye
rye / formatting.patch
Created December 2, 2012 18:52
samercier/riversDiary formatting fix
From a4024c35295c0d7375ce87ff666f0dffe75f4aa1 Mon Sep 17 00:00:00 2001
From: Kristofer Rye <krye97@gmail.com>
Date: Sun, 2 Dec 2012 13:48:36 -0500
Subject: [PATCH] moved javascript code to /js/ directory
---
Diary.html | 6 +-
jquery-1.8.3.min.js | 2 -
jquery-ui-1.9.2.custom.min.js | 6 --
jquery.easing.1.3.js | 205 --------------------------------------
\documentclass[12pt,letterpaper]{article}
\usepackage{amsmath}
\usepackage{setspace}
\begin{document}
\begin{center}
{\Huge{\textbf{Prevent Memory Errors}}}
@rye
rye / say_time.sh
Last active December 31, 2015 22:49
This is something that just says the time.
#!/bin/sh
DEFAULT_MODE="HOURLY"
case $1 in
"" | "--hourly")
MODE="HOURLY"
;;
"--quarterly")
MODE="QUARTERLY"
@rye
rye / userlist.sh
Last active August 29, 2015 13:55
Get the users on a nix box and dump them out into a pretty table.
#!/bin/bash
cat /etc/passwd | cut -d: -f1,3,5,6 | grep "1[0-9][0-9][0-9]" | cut -d: -f1,3,4 | grep "/home" | cut -d: -f1,2 | column -t -s : | sort
@rye
rye / vomit.ru
Last active January 30, 2017 11:38
A Ruby web server to act like Python's SimpleHTTPServer module.
#!/usr/bin/env rackup
#\ -E deployment
use Rack::ContentLength
app = Rack::Directory.new Dir.pwd
run app
@rye
rye / datasync.rb
Last active August 29, 2015 14:00
My data synchronization system.
#!/usr/bin/env ruby
require "json"
module DataSync
EXAMPLE_CONFIGURATION_FILE_NAME = "z_datasync-configuration.sample.json"
CONFIGURATION_FILE_NAME = "configuration.json"
OutputProperties = {
@rye
rye / porto.rb
Last active August 29, 2015 14:01
A small ruby module for determining if ports are open.
require 'socket'
require 'timeout'
module Porto
class PortoPort
def self.in_use?(ip, port)
begin
Timeout::timeout(1) do
begin
s = TCPSocket.new(ip, port)
@rye
rye / stddev.rb
Last active August 29, 2015 14:01
A handy little Array class extension for calculating standard deviation of an array
class Array
def mean
return ((self.map{|x| x.to_f}
.inject(:+)) /
(self.count))
end
def standard_deviation
m = self.mean
@rye
rye / wat.txt
Created June 23, 2014 14:10
lol wat
neonatestail
penrumings
unisi
gooproach
destoolsnant
lopdurablee
falsenalhen
govnobsis
intenlog
loottylows
@rye
rye / kiosk-install.sh
Last active August 29, 2015 14:02
An installer for the Kiosk system for the WLCSC libraries.
#!/bin/sh
echo ">>>> Copying archive to home directory!"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cp $DIR/zz_config-diffs.tar.gz $HOME
echo ">>>> Changing to home directory!"