Skip to content

Instantly share code, notes, and snippets.

View orb's full-sized avatar

Norman Richards orb

View GitHub Profile
@orb
orb / swap.sh
Created May 21, 2015 23:59
digital ocean swap file
fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
sh -c 'echo "/swapfile none swap sw 0 0" >> /etc/fstab'
@orb
orb / install.sh
Last active December 4, 2015 02:41
deploy tomcat digital ocean
fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
sh -c 'echo "/swapfile none swap sw 0 0" >> /etc/fstab'
apt-get update
apt-get install -y tmux emacs24-nox openjdk-7-jdk tomcat7 tomcat7-admin libhsqldb-java nginx haveged
cat > /etc/nginx/sites-available/myapp <<EOF
@orb
orb / Split.java
Created April 29, 2015 00:50
trivial Markdown4j example
package zoo;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.markdown4j.Markdown4jProcessor;
@orb
orb / InsertBusinessProfile.java
Last active August 29, 2015 14:20
student code
package sergio.project.specialsApp;
import java.io.IOException;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@orb
orb / recruiter.md
Last active May 8, 2018 12:50
I couldn't understand an email from a recruiter, so I used google translate and got this:

Dear keyword match,

You vaguely look like someone capable of doing work.

I have a couple jobs that I'm not going to bother to describe because that would have meant I needed to take the time to look at your actual experience and see if any of them are actually a fit. But trust me, these are big time real jobs that actually exist and would be perfect for you based on the fact that you matched a keyword.

Instead of telling you more, I'm going to ask you to tell me what you are doing now. If my fishing trip is successful, then I'll take the time to look and see if you might be a fit for one of the jobs I'm recruiting for. If you are, I might get back to you.

Thanks for your time, Recruiter Dude.

@orb
orb / coder.clj
Created April 14, 2015 01:06
Austin Clojure 4/13 alphabet-cipher
(ns alphabet-cipher.coder)
(defn char->num [char]
(- (int char) (int \a)))
(defn num->char [ch]
(char (+ (int ch) (int \a))))
(defn mod26 [n]
(mod n 26))
@orb
orb / core.clj
Created April 10, 2015 18:13
refactoring some come
(ns dataprep.core
(:require [clojure.java.io :as io]
[clojure.string :as s]
[clojure.data.csv :as csv]
[semantic-csv.core :as sc]
[clj-http.lite.client :as http]))
(defn clean-latlon [angle]
"The purpose of this function is to verify that lat long is clean."
(s/replace angle #"[^0-9\.\-]" ""))
@orb
orb / minikanren.rb
Created April 5, 2015 03:01
some ruby minikanren scribblings
require 'mini_kanren'
include MiniKanren::Extras
$section = "--"
def section!(label)
$counter = 0
puts "====== #{label}"
end
@orb
orb / closing_time.clj
Created February 9, 2015 04:09
It's closing time.
(run* [your-location]
(conde
[(== your-location :home)]
[succeed])
(!= your-location :here))
@orb
orb / uni.clj
Created February 8, 2015 22:20
clojure unification tests
(ns hufflepuff.uni
(:require [clojure.core.logic :refer [defnc fnc]]
[clojure.core.logic.unifier :refer [unifier unify]]))
(defnc numberc [x]
(number? x))
(defnc symbolc [x]
(symbol? x))