Skip to content

Instantly share code, notes, and snippets.

View ppanyukov's full-sized avatar

Philip Panyukov ppanyukov

  • UK
View GitHub Profile
@ppanyukov
ppanyukov / sshtunnel.go
Created January 23, 2018 20:13 — forked from iamralch/sshtunnel.go
SSH tunnelling in Golang
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"
@ppanyukov
ppanyukov / log.go
Created October 31, 2017 21:41 — forked from cespare/log.go
Golang apache logging
type ApacheLogRecord struct {
http.ResponseWriter
ip string
time time.Time
method, uri, protocol string
status int
responseBytes int64
elapsedTime time.Duration
}
@ppanyukov
ppanyukov / socketadapter.py
Created November 24, 2016 12:31 — forked from mminer/socketadapter.py
Connection adapter for Requests that allows it to talk with raw UNIX sockets.
"""
Connection adapter for Requests that allows it to talk with raw UNIX sockets.
Adapted from requests-unixsocket, which itself was adapted from docker-py.
https://github.com/msabramo/requests-unixsocket
https://github.com/docker/docker-py/blob/master/docker/unixconn/unixconn.py
"""
import socket
from urllib.parse import unquote, urlparse
@ppanyukov
ppanyukov / about.md
Created August 10, 2011 11:46 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@ppanyukov
ppanyukov / Prelude.cs
Created July 29, 2011 09:31 — forked from anonymous/Prelude.cs
Oh, you poor, poor imperative developers...
/* Prelude.cs : What happens when a haskell programmer learns C#.
Copyright (c) 2011 Clark Gaebel
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
@ppanyukov
ppanyukov / gist:1035407
Created June 20, 2011 10:22
Using p4merge with Git Mac OS X or Ubuntu

Git config

$ git config --global -e
[merge]
    keepBackup = false;
    tool = p4merge
[mergetool "p4merge"]
    cmd = p4merge "$BASE" "$REMOTE" "$LOCAL" "$MERGED"

keepTemporaries = false

@ppanyukov
ppanyukov / markdown.vim
Created June 15, 2011 12:06 — forked from natesilva/markdown.vim
Vim: Preview a Markdown document in the default browser on Windows or Mac OS X
"
" While editing a Markdown document in Vim, preview it in the
" default browser.
"
" Author: Nate Silva
"
" To install: Place markdown.vim in ~/.vim/ftplugin or
" %USERPROFILE%\vimfiles\ftplugin.
"
" To use: While editing a Markdown file, press ',p' (comma p)