Skip to content

Instantly share code, notes, and snippets.

View Tethik's full-sized avatar
👾
Up to no good

Joakim Uddholm Tethik

👾
Up to no good
View GitHub Profile
@Tethik
Tethik / fibonacci using binets formula
Created March 11, 2014 03:58
Worse than dynprog solution :(
package main
import (
"fmt"
"math"
"math/big"
"runtime"
)
func doPow(v *big.Rat, n int64) (*big.Rat) {
import sys
'''
Returns a list of sorted tuples of the letter distribution.
'''
def count(text):
letter_counts = dict()
#~ for char in alphabet.alphabetstr:
#~ letter_counts[char] = 0
@Tethik
Tethik / portscan.py
Created May 2, 2014 12:54
Basic tcp portscan script.
import socket
import threading
from queue import Queue
def is_open(host, port):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(0.5)
try:
s.connect((host, port))
s.close()
@Tethik
Tethik / gist:3ae7e1c188c4503bf5c0
Last active August 29, 2015 14:03
AngularJS Autoresizing iframe
if (parent && window.frameElement)
$interval(function () {
window.frameElement.style.height = (document.body.offsetHeight + 60) + "px";
}, 10);
@Tethik
Tethik / comb.py
Last active August 29, 2015 14:06
Random Tumblr Request.
import sys
list1, list2 = [],[]
for line in sys.stdin:
line = line.strip()
if line == "":
break
parts = line.split(" ")
list1.append(parts[0])
if len(parts) > 1:

Keybase proof

I hereby claim:

  • I am Tethik on github.
  • I am tethik (https://keybase.io/tethik) on keybase.
  • I have a public key whose fingerprint is F6FA 724C A019 7D73 88C0 2211 54E3 CB53 BD1A 5FAE

To claim this, I am signing this object:

router.get('/:name/tpl', function(req, res, next) {
var fileName = req.params.name + ".html";
var options = {
root: __dirname + '/public/',
dotfiles: 'deny',
};
res.sendfile(fileName, options, function (err) {
if (err) {
#0 [PASS] 204ms
#1 [FAIL] 11009ms Timeout!
#2 [PASS] 961ms
#3 [PASS] 1246ms
#4 [PASS] 1410ms
#5 [PASS] 41ms
#6 [FAIL] 11009ms Timeout!
#7 [PASS] 125ms
#8 [PASS] 40ms
#9 [PASS] 3520ms
Alpha.
0.09675840000000001 0.0532172 0.0498306 0.0485728
0.013805496000000004 0.024127696000000004 0.011928384 0.011878072000000003
0.003021805760000001 0.0034346937600000012 0.005893442560000001 0.002944708800000001
7.326582656000003E-4 7.491737856000003E-4 8.475237376000003E-4 0.0014591487744000005
1.8084651315200008E-4 1.815071339520001E-4 1.8544113203200008E-4 4.1981226700800017E-4
9.187628474368005E-5 4.596456720384003E-5 4.612192712704003E-5 5.549677252608003E-5
2.6506866907545617E-5 1.1416964752179207E-5 1.1423259149107208E-5 1.1798252965068807E-5
3.506088427257859E-6 5.8049846820864054E-6 2.902744116920322E-6 2.917743869558786E-6
7.455059809232494E-7 1.6749236622327824E-6 7.213722085097479E-7 7.219721986152865E-7
@Tethik
Tethik / gist:7106814
Created October 22, 2013 19:36
HMM4 output
Input:
rows[0] = "4 4 0.4 0.2 0.2 0.2 0.2 0.4 0.2 0.2 0.2 0.2 0.4 0.2 0.2 0.2 0.2 0.4";
rows[1] = "4 4 0.4 0.2 0.2 0.2 0.2 0.4 0.2 0.2 0.2 0.2 0.4 0.2 0.2 0.2 0.2 0.4";
rows[2] = "1 4 0.241896 0.266086 0.249153 0.242864";
rows[3] = "10 0 1 2 3 3 0 0 1 1 1";
Alpha:
0.389559503822787 0.21425804919095415 0.2006232410952617 0.19555920589099723
0.2236082719486836 0.3907974337657384 0.19320460006509918 0.19238969422047889
0.19757271896617493 0.22456830083590637 0.3853270405607323 0.1925319396371864