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
  • 22:20 (UTC -12:00)
View GitHub Profile
@neumachen
neumachen / generator.go
Created December 30, 2016 10:21 — forked from mfojtik/generator.go
Simple generator for Golang
package main
import (
"fmt"
"log"
"math/rand"
"regexp"
"strconv"
"strings"
"time"
@neumachen
neumachen / handler.go
Created January 25, 2017 19:34 — forked from rjz/handler.go
Handle Github webhooks with golang
// Now available in package form at https://github.com/rjz/githubhook
package handler
// https://developer.github.com/webhooks/
import (
"crypto/hmac"
"crypto/sha1"
"encoding/hex"
"errors"
@neumachen
neumachen / select2-cascade.js
Created February 22, 2017 14:56 — forked from ajaxray/ select2-cascade.js
Making Select2 (4.x) list boxes cascading / dependent. Options of a select2 list box will be loaded/refreshed by ajax based on selection of another select2 list box.
/**
* A Javascript module to loadeding/refreshing options of a select2 list box using ajax based on selection of another select2 list box.
*
* @url : https://gist.github.com/ajaxray/187e7c9a00666a7ffff52a8a69b8bf31
* @auther : Anis Uddin Ahmad <anis.programmer@gmail.com>
*
* Live demo - https://codepen.io/ajaxray/full/oBPbQe/
* w: http://ajaxray.com | t: @ajaxray
*/
var Select2Cascade = ( function(window, $) {
@neumachen
neumachen / report.rb
Created April 26, 2017 02:35 — forked from abhishek77in/report.rb
Create a PDF Document using Prawn Library with header, footer and page numbering.
require "prawn"
Prawn::Document.generate("report.pdf") do
10.times do
start_new_page
end
repeat :all do
move_down 50
@neumachen
neumachen / keys.go
Created June 24, 2017 19:03 — forked from sdorra/keys.go
Golang RSA Key Generation
/*
* Genarate rsa keys.
*/
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
@neumachen
neumachen / postgres_array.go
Created July 19, 2017 04:00 — forked from adharris/postgres_array.go
PostgreSQL demo of Array types using Golang
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"
@neumachen
neumachen / README.md
Created August 2, 2017 01:52 — forked from clhenrick/README.md
PostgreSQL & PostGIS cheatsheet (a work in progress)
@neumachen
neumachen / upload.go
Created August 14, 2017 14:16 — forked from ebraminio/upload.go
golang upload client and server
// curl -X POST -H "Content-Type: application/octet-stream" --data-binary '@filename' http://127.0.0.1:5050/upload
package main
import (
"fmt"
"io"
"net/http"
"os"
"time"
@neumachen
neumachen / KongJwt.md
Created January 9, 2018 22:48 — forked from martinheld/KongJwt.md
Short example to use JWT with Kong

JWT Kong Example

  • Get and Start Kong and Co
git clone git@github.com:Mashape/docker-kong.git
cd docker-kong/compose
docker-compose up
  • Create Kong API Route
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: default-view
subjects:
- kind: ServiceAccount
name: kubernetes-dashboard
namespace: default
- kind: ServiceAccount
name: kubernetes-dashboard