Skip to content

Instantly share code, notes, and snippets.

View moleike's full-sized avatar
🤘
dare to think for yourself

Alexandre Moreno moleike

🤘
dare to think for yourself
View GitHub Profile
@moleike
moleike / App.java
Created April 28, 2020 10:03 — forked from thomasdarimont/App.java
Simple AuthN & AuthZ example with Spring Boot / Security / Session
package demo;
import java.io.Serializable;
import java.security.Principal;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@moleike
moleike / http-errors.js
Last active December 22, 2019 21:13 — forked from justmoon/custom-error.js
HTTP Error classes in Node.js
'use strict';
const statusCodes = require('http').STATUS_CODES;
function createError(code, name) {
return function(message) {
Error.captureStackTrace(this, this.constructor);
this.name = name;
this.message = message;
this.statusCode = code;
}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeOperators #-}

Keybase proof

I hereby claim:

  • I am moleike on github.
  • I am moleike (https://keybase.io/moleike) on keybase.
  • I have a public key whose fingerprint is CDC4 894D F650 5812 3224 B997 C5CD DE66 C45A DD8F

To claim this, I am signing this object:

import io.finch._
import io.finch.syntax._
import shapeless._
import scala.language.existentials
trait Route {
private object base extends Endpoint[HNil] {
def apply(input: Input): Endpoint.Result[HNil] = EndpointResult.NotMatched
}
@moleike
moleike / pair_programming_roles
Created March 23, 2018 02:22 — forked from jordanpoulton/pair_programming_roles
Pair Programming Role Definitions - Driver:Navigator
Driver:
-Write the code according to the navigator's specification
-Listen intently to the navigators instructions
-Ask questions wherever there is a lack of clarity
-Offer alternative solutions if you disagree with the navigator
-Where there is disagreement, defer to the navigator. If their idea fails, get to failure quickly and move on
-Make sure code is clean
-Own the computer / keyboard
-Ignore larger issues and focus on the task at hand
-Trust the navigator - ultimately the navigator has the final say in what is written
@moleike
moleike / ssh_client.go
Created March 15, 2018 06:59 — forked from iamralch/ssh_client.go
SSH client in GO
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@moleike
moleike / tmux-cheatsheet.markdown
Created March 9, 2018 04:13 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@moleike
moleike / Makefile
Created March 2, 2018 00:45 — forked from llj098/Makefile
a sample tcp server runs in kernel
obj-m += tcp_svr_sample.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clea
@moleike
moleike / memory_layout.md
Created January 14, 2018 16:59 — forked from CMCDragonkai/memory_layout.md
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore