I hereby claim:
- I am xintron on github.
- I am xintron (https://keybase.io/xintron) on keybase.
- I have a public key whose fingerprint is C405 076E CEF6 FC4B 0E5B E0BA 0070 8663 08C1 7775
To claim this, I am signing this object:
{-# LANGUAGE OverloadedStrings #-} | |
import Control.Monad (unless) | |
import Control.Exception (bracket) | |
import System.Environment (getArgs) | |
import System.IO (Handle, BufferMode(NoBuffering), hClose, hSetBuffering) | |
import Data.Time.LocalTime (getZonedTime) | |
import Network (PortID(PortNumber), connectTo) | |
import qualified Data.Text as T (Text, append, concat, drop, dropWhile, head, | |
isPrefixOf, pack, takeWhile, toLower, words) | |
import qualified Data.Text.IO as TIO (hGetLine, hPutStr, putStrLn) |
getProcessDirectories = getDirectoryContents procPath >>= | |
filterM (doesDirectoryExist . (++) procPath) . filter (all isNumber) >>= | |
mapM (return . (++) procPath) | |
where | |
procPath = "/proc/" |
I hereby claim:
To claim this, I am signing this object:
from django.test.simple import DjangoTestSuiteRunner | |
from django.test import TransactionTestCase | |
from mongoengine import connect | |
class TestRunner(DjangoTestSuiteRunner): | |
def setup_databases(self, **kwangs): | |
db_name = 'testsuite' | |
connect(db_name) | |
print 'Creating test-database: ' + db_name |
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
import logging | |
from mpd import MPDClient, CommandError | |
from tornado.httpserver import HTTPServer | |
from tornado.ioloop import IOLoop | |
from tornado.web import Application | |
from tornado.websocket import WebSocketHandler |
import unittest | |
from flask.ext.script import Manager, Server | |
from project import app, db | |
manager = Manager(app) | |
class Serve(Server): | |
def handle(self, *args, **kwargs): |
<?php | |
$url = 'http://www.trafiken.nu/TrafikenServices/TraveltimeService.ashx?method=getTraveltime®ion=VST§ionId=3001'; | |
$c = curl_init($url); | |
$options = array( | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_HTTPHEADER => array('Content-type: application/json') | |
); | |
curl_setopt_array($c, $options); | |
$data = curl_exec($c); |
<?php | |
$data = array(); | |
$time = array(); | |
for ($i = 97; $i < 173; $i++) | |
$data[chr($i)] = $i; | |
$s = microtime(true); | |
for ($i = 0; $i < 1000000; $i++) { | |
isset($data['g']); |
location /code/ { | |
try_files $uri $uri/index.html =404; | |
} | |
location ~ /code/(?<uri_path>.*/)(?<page>\d+)$ { | |
try_files $uri $uri_path/index$page.html =404; | |
} | |
location ~ /foo/.*.html { | |
return 404; |
#!/usr/bin/env python3 | |
# encoding: utf-8 | |
import os | |
import sys | |
import argparse | |
def parse_arguments(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument('file') |