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:
I hereby claim:
To claim this, I am signing this object:
| getProcessDirectories = getDirectoryContents procPath >>= | |
| filterM (doesDirectoryExist . (++) procPath) . filter (all isNumber) >>= | |
| mapM (return . (++) procPath) | |
| where | |
| procPath = "/proc/" |
| {-# 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) |
| import qualified Data.Text.Lazy as T (Text, lines, unlines) | |
| import qualified Data.Text.Lazy.IO as TIO (interact) | |
| data Command = Next | |
| sed :: T.Text -> T.Text | |
| sed t = T.unlines $ concat $ map (runCommands [Print]) $ T.lines t | |
| runCommands :: [Command] -> T.Text -> [T.Text] |
| func (conn *Conn) Connect(host string) (c net.Conn, err error) { | |
| log.SetFlags(23) | |
| log.Printf("Connecting to host: %s\n", host) | |
| // Wrapp the connection with a secure connection | |
| if conn.SSL { | |
| c, err = tls.Dial("tcp", host, conn.SSLConfig) | |
| } else { | |
| c, err = net.Dial("tcp", host) | |
| } | |
| if err != nil { |
| <?php | |
| $s = microtime(true); | |
| $c = 0; | |
| foreach(range(1, 100000) as $i) { | |
| $c++; | |
| } | |
| $e = microtime(true); | |
| printf("Foreach :: Time: %f, count: %d\n", $e-$s, $c); | |
| $s = microtime(true); |
| #!/bin/bash | |
| # Original: http://frexx.de/xterm-256-notes/ | |
| # http://frexx.de/xterm-256-notes/data/colortable16.sh | |
| # Modified by Aaron Griffin | |
| # and further by Kazuo Teramoto | |
| FGNAMES=(' black ' ' red ' ' green ' ' yellow' ' blue ' 'magenta' ' cyan ' ' white ') | |
| BGNAMES=('DFT' 'BLK' 'RED' 'GRN' 'YEL' 'BLU' 'MAG' 'CYN' 'WHT') | |
| echo " ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" |
| <?php | |
| class Foo { | |
| public function __construct() { | |
| var_dump(get_object_vars($this)); | |
| } | |
| } | |
| class Bar { | |
| public function __construct(Array $args) { | |
| foreach ($args as $key => $value) { |
| #!/usr/bin/env python3 | |
| # encoding: utf-8 | |
| import os | |
| import sys | |
| import argparse | |
| def parse_arguments(): | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('file') |
| 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; |