Skip to content

Instantly share code, notes, and snippets.

View Tombert's full-sized avatar

Tombert

  • Monadic LLC.
  • United States
View GitHub Profile
open System
open Microsoft.Xna.Framework
open Microsoft.Xna.Framework.Input
open Microsoft.Xna.Framework.Graphics
type FNAGame() as self =
(ns homomorph.core
(:gen-class))
(import java.security.SecureRandom)
(defn lcm [a b] (.divide (.multiply a b) (.gcd a b)))
(defn makePublicKey [bits nn]
(let [n (biginteger nn)]
{
:bits (biginteger bits)
:n n
:n2 (.pow n 2)
genomeTypes =
Dict(
[0,0,0,1] => "1",
[0,0,1,0] => "2",
[0,0,1,1] => "3",
[0,1,0,0] => "4",
[0,1,0,1] => "5",
[0,1,1,0] => "6",
@Tombert
Tombert / APIDraft
Created March 7, 2016 05:18
Hello!
This is a basic draft of the API right now.
`GET /events`
[{
"name": "Tombert's Cool Event",
"id":1,
"data":"{
\"date\":\"12-15-2016\",
\"description\":\" Where tomberts come to grow \"
@Tombert
Tombert / randcat.py
Last active February 3, 2016 22:28
RandCat
#! /usr/bin/python3
import calendar
import time
seed = calendar.timegm(time.gmtime()) # We'll use the epoch time as a seed.
def random (seed):
seed2 = (seed*297642 + 83782)/70000
return int(seed2) % 70000;
require 'digest/md5'
def hashKey(key)
md5 = Digest::MD5.hexdigest("bobby"
int_md5 = md5.to_i(16)
return int_md5 % max_length
end
@Tombert
Tombert / nginx.conf
Created August 28, 2015 15:48
nginx stuf
server {
listen 80;
server_name brucewillis.sexy;
return 301 https://www.brucewillis.sexy$request_uri;
}
server {
listen 443 ssl;
server_name brucewillis.sexy www.brucewillis.sexy;
@Tombert
Tombert / server.c
Created July 17, 2015 22:57
basicserver.c
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/ip.h> /* superset of previous */
int main( int argc, char **argv){
int tcp_socket;
==> cowboy (compile)
Compiled src/cowboy_acceptors_sup.erl
Compiling src/cowboy_listener.erl failed:
src/cowboy_listener.erl:30: type queue/0 is deprecated and will be removed in OTP 18.0; use use queue:queue/0 or preferably queue:queue/1
src/cowboy_listener.erl:211: type queue/0 is deprecated and will be removed in OTP 18.0; use use queue:queue/0 or preferably queue:queue/1
src/cowboy_listener.erl:211: type queue/0 is deprecated and will be removed in OTP 18.0; use use queue:queue/0 or preferably queue:queue/1
Could not compile dependency cowboy, /usr/bin/rebar command failed. If you want to recompile this dependency, please run: mix deps.compile cowboy
@Tombert
Tombert / rc.lua
Last active August 29, 2015 14:22
My AwesomeWM config
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
awful.rules = require("awful.rules")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library