This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "net/http" | |
require "pry" | |
# Parameters for episode looping. | |
# | |
# Note that 404 seems to be reserved for whining. | |
MIN_EPISODE_NUMBER = 001 | |
MAX_EPISODE_NUMBER = 417 | |
FORMAT = ".ogv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "matrix" | |
require "pry" | |
class Integer | |
# Method to compute binomial coefficient nCk (where n is this object, | |
# and k is some other integer. | |
def choose(k) | |
# n! / (n-k)! | |
top = (((self-k)+1)..(self)).inject(1, &:*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ruby -e "\"`ps -ef|grep \<defunct\>`\".split(/$/).each{|l|puts(l.match(/^(?<user>\w+)\W+(?<pid>\d+)\W+(?<ppid>\d+)/)[:pid])}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'uri' | |
require 'net/http' | |
module Monoid | |
class Site | |
attr_accessor :base_uri | |
def initialize(base_uri = URI.parse('https://larsenwork.com')) | |
@base_uri = base_uri | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[12pt,letterpaper]{article} | |
\usepackage{amsmath} | |
\usepackage{setspace} | |
\begin{document} | |
\begin{center} | |
{\Huge{\textbf{Prevent Memory Errors}}} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DEFAULT_MODE="HOURLY" | |
case $1 in | |
"" | "--hourly") | |
MODE="HOURLY" | |
;; | |
"--quarterly") | |
MODE="QUARTERLY" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = clang | |
LD = ld | |
LDSHARED = clang -dynamic -bundle | |
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Werror=implicit-int -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration -Werror=division-by-zero -Werror=deprecated-declarations -Werror=extra-tokens -pipe | |
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -fPIE | |
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin16 -I./include -I. -I./enc/unicode/data/8.0.0 | |
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -fstack-protector -Wl,-u,_objc_msgSend -Wl,-pie -framework CoreFoundation | |
SOLIBS = -lgmp | |
Apple LLVM version 8.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env rackup | |
#\ -E deployment | |
use Rack::ContentLength | |
app = Rack::Directory.new Dir.pwd | |
run app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function check_user_and_host { | |
_ssh_result=$(ssh -o ConnectTimeout=5 -o BatchMode=yes -o StrictHostKeyChecking=no $1@$2 "echo \"\`who | grep -c . \`\"; true" 2>/dev/null) | |
} | |
function check_and_output_host { | |
check_user_and_host $1 $2 && echo "$2: up, $_ssh_result users logged in" || echo "$2: down" | |
} |