Skip to content

Instantly share code, notes, and snippets.

Oleku Konko olekukonko

Block or report user

Report or block olekukonko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View orhttp_example.go
// To the extent possible under law, the Yawning Angel has waived all copyright
// and related or neighboring rights to orhttp_example, using the creative
// commons "cc0" public domain dedication. See LICENSE or
// <http://creativecommons.org/publicdomain/zero/1.0/> for full details.
package main
import (
// Things needed by the actual interface.
"golang.org/x/net/proxy"
View script.sh
ls -la
echo "hello"
tree
adb devices
adb wait-for-device #example of a long running task
View jsonResponseWriter.go
// call this function from a http Handler Func, where data is the response object
// response will be compressed with gzip if requester accepts it
// browser should automatically decompress into valid json
func jsonResponseWriter(w http.ResponseWriter, r *http.Request, data interface{}) error {
var err error
var jsonData []byte
if jsonData, err = json.Marshal(data); err != nil {
return err
}
w.Header().Set("Content-Type", "application/json")
View SSHCommander.go
package main
import (
"fmt"
"os"
"os/exec"
)
type SSHCommander struct {
User string
View whiteboardCleaner.md

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

View simplexml-table-iteration.php
<?php
/**
* PHP XML to dynamic table
*
* @link http://stackoverflow.com/q/16997835/367456
*/
require('.../Iterator-Garden/src/autoload.php'); // for DecoratingIterator - use development branch
@olekukonko
olekukonko / parseInt64.go
Created Apr 26, 2014
strconv.ParseInt Faster Implementation to convert strings to int64
View parseInt64.go
// Ascii numbers 0-9
const (
ascii_0 = 48
ascii_9 = 57
)
// parseInt64 expects decimal positive numbers. We
// return -1 to signal error
func parseInt64(d []byte) (n int64) {
if len(d) == 0 {
View slowloris.php
#! /usr/bin/env php
<?php
/* PHP Slowloris
* Adapted from the script found here: http://seclists.org/fulldisclosure/2009/Jun/207
* Contains get based attack (slow headers) and post based attack (long content length)
*
* Author: Seppe vanden Broucke
*/
function usage($argv){
View build.md

Hide console Window when go applcation is lunched

go build -ldflags="-H windowsgui" -o prog.exe prog.go
View gist:9574562
# Download Sublime Text 2 from http://www.sublimetext.com/2
# If you aren't root, sudo su
tar -xvjf Sublime\ Text\ 2*.tar.bz2
mv Sublime\ Text\ 2/ /opt/sublime-text-2/
ln -s /opt/sublime-text-2 /usr/local/sublime-text-2
ln -s /usr/local/sublime-text-2/sublime_text /usr/local/bin/sublime_text
rm Sublime\ Text\ 2*.tar.bz2
# Sublime Text 2 can now be run as normal user with command "sublime_text"
You can’t perform that action at this time.