Skip to content

Instantly share code, notes, and snippets.

View neumachen's full-sized avatar
🏠
Working from home

Kareem H neumachen

🏠
Working from home
  • Bergen, Norway
  • 19:12 (UTC -12:00)
View GitHub Profile
@neumachen
neumachen / rpn.go
Created July 18, 2016 02:25
Reverse Polish Notation Calculator
package main
import (
"fmt"
"strconv"
"unicode"
"unicode/utf8"
)
func skipSpaces(s []byte) []byte {
@neumachen
neumachen / RELK.sh
Created July 24, 2016 20:41 — forked from adionditsak/RELK.sh
Install the ELK stack (with Redis) with one script for the central log server (CentOS 6.5).
#/bin/bash
##########################################################
### INTRODUCTION
##########################################################
: '
Install and configure R (Redis) + ELK server from scratch on CentOS 6.5.
* Logstash version 1.4.2
* Elasticsearch version 1.3.2
@neumachen
neumachen / Vagrantfile
Created July 28, 2016 17:10 — forked from davisford/Vagrantfile
Vagrantfile with postgres
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$script = <<SCRIPT
echo "-------------------- updating package lists"
apt-get update
@neumachen
neumachen / golang_job_queue.md
Created July 31, 2016 20:48 — forked from harlow/golang_job_queue.md
Job queues in Golang
@neumachen
neumachen / README.md
Created August 4, 2016 18:26 — forked from jonathantneal/README.md
createElement.js // a 300 byte DOM Element creator

createElement.js

createElement.js lets document.createElement use CSS selectors.

This is a pretty useful library for building out DOM elements. The whole thing runs on one regex and a for loop, so it’s plenty fast. The script is 300 bytes when compressed and gzipped. For 524 bytes (advanced), it includes nesting support and can generate entire DOM hierarchies, including text nodes.

Usage

document.createElement(); // generates <div />
@neumachen
neumachen / db.go
Created August 16, 2016 13:21 — forked from SchumacherFM/db.go
GoLang Database SQL: Selecting an unknown amount of columns from a query. Benchmark results in db_test.go
package main
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
"log"
)
const (
@neumachen
neumachen / config.yml
Created August 18, 2016 19:18 — forked from seratch/config.yml
AWS SQS Example
access_key_id: xxx
secret_access_key: yyy
@neumachen
neumachen / nginxproxy.md
Created September 2, 2016 15:53 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

Keybase proof

I hereby claim:

  • I am magicalbanana on github.
  • I am manbearpig (https://keybase.io/manbearpig) on keybase.
  • I have a public key whose fingerprint is 7ED3 0E32 6243 C187 A302 08C3 374C 3667 270F A9FD

To claim this, I am signing this object:

@neumachen
neumachen / http-benchmark.md
Created December 22, 2016 16:13 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)

Tools

Located in alphabetical order (not prefer)

  • ab – slow and single threaded, written in C
  • apib – most of the features of ApacheBench (ab), also designed as a more modern replacement, written in C
  • baloo – Expressive end-to-end HTTP API testing made easy, written in Go (golang)
  • bombardier – Fast crossplatform HTTP benchmarking tool, written in Go (golang)
  • curl-loader – performance loading of various application services and traffic generation, written in C
  • gatling – High performance load testing framework based on Scala, Akka and Netty, write in Scala