Skip to content

Instantly share code, notes, and snippets.

View XanderStrike's full-sized avatar

Alexander Standke XanderStrike

View GitHub Profile
@XanderStrike
XanderStrike / fibs.rb
Last active August 29, 2015 14:23
fibs.rb
# ruby fibs
require 'benchmark'
# === stupid ===
def recursive_fib(n)
n <= 1 ? n : recursive_fib(n-1) + recursive_fib(n-2);
end
puts Benchmark.measure { recursive_fib(35) }
function fast_double_fib(n) {
var a, b, c, d
if (n == 0) {
return [0, 1]
} else {
l = fast_double_fib(Math.floor(n / 2))
a = l[0]
b = l[1]
c = a * (b * 2 - a)
d = a * a + b * b
# sample proxypass for couchpotato, rails apps, etc
<VirtualHost *:80>
ServerName test.xanderstrike.com
ServerAdmin [email protected]
ProxyPreserveHost On
<Location />
Require all granted
ProxyPassReverse http://127.0.1:3000
@XanderStrike
XanderStrike / server_index.html
Last active December 1, 2018 06:43
stupid simple plex server index page
<!DOCTYPE html>
<html>
<head>
<title>Example Server</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/png" href="/public/img/favicon.png">
</head>
<body>
<div id="header">
@XanderStrike
XanderStrike / fillgaps.rb
Last active June 28, 2021 22:09
API Glue between JasonHHouse/gaps and tidusjar/Ombi
#!/usr/bin/env ruby
# fillgaps.rb
# Alex Standke 2021
#
# Requirements:
# * You must have Gaps and Ombi set up and running
# * https://github.com/JasonHHouse/gaps
# * https://github.com/tidusjar/Ombi
#
{
"event": "media.pause",
"user": true,
"owner": true,
"Account": {
"id": 1,
"thumb": "<redacted>",
"title": "<redacted>"
},
"Server": {