Skip to content

Instantly share code, notes, and snippets.

View dirkarnez's full-sized avatar
💪
want a lot of sleep...

Dirk Arnez dirkarnez

💪
want a lot of sleep...
  • Freelance
  • Hong Kong
View GitHub Profile
@dirkarnez
dirkarnez / build.gradle
Created July 16, 2020 08:42 — forked from TurekBot/build.gradle
Gradle Shadow Example
group 'com.github.yourusername'
version '1.0-SNAPSHOT'
//These are dependencies that have to do with just the build. See: https://stackoverflow.com/a/23627293/5432315
buildscript {
repositories {
jcenter()
}
dependencies {
//This is necessary to use the gradle shadow plugin
@dirkarnez
dirkarnez / alias.cmd
Created April 21, 2020 08:33 — forked from benjamine/alias.cmd
Aliases for windows command line
::
:: Aliases for windows command line
::
:: Installation:
::
:: - create a folder for your aliases (eg: ```c:\cmd-aliases```)
:: - add that folder to your PATH variable
:: - save this script as setalias.cmd on that folder
:: - run "alias" to see usage
::
@dirkarnez
dirkarnez / Dockerfile
Created February 19, 2020 14:44 — forked from PurpleBooth/Dockerfile
Create a static binary in go and put it in a from scratch docker container
FROM golang:1.9
WORKDIR /go/src/github.com/purplebooth/example
COPY . .
RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go
FROM scratch
COPY --from=0 /go/src/github.com/purplebooth/example/main /main
CMD ["/main"]
@dirkarnez
dirkarnez / Makefile
Created September 6, 2019 20:05 — forked from hibariya/Makefile
Calling c function from x86-64 assembly code (System V AMD64 ABI)
OBJECTS = func.o main.o
CC = gcc
CFLAGS = -std=c11 -m64 -Wall -Wextra -Werror -c
AS = nasm
ASFLAGS = -f elf64
all: $(OBJECTS)
gcc -m64 $(OBJECTS) -o main
run: all
@dirkarnez
dirkarnez / 0_main.cxx
Created July 10, 2019 08:41 — forked from xiongjia/0_main.cxx
A simple sample of Boost DLL #boost #devsample
/**
* A simple sample of Boost DLL
*/
#include <iostream>
#include "boost/shared_ptr.hpp"
#include "boost/function.hpp"
#include "boost/dll/import.hpp"
#include "1_plugin.hxx"
@dirkarnez
dirkarnez / redux-ecosystem-without-redux.js
Created March 1, 2019 02:22 — forked from slorber/redux-ecosystem-without-redux.js
Use Redux ecosystem without Redux
////////////////////////////////////////////////////////////////////////
// Intro
///////////////////////
// Tools like Redux-saga, React-redux and Reselect can easily be used without Redux
// For Reselet there's nothing to do, it's just not coupled to Redux
// For the others, you just need to provide an adapter
// At Stample.co we use a legacy framework that is quite close to Redux but with a bad API
// We want to progressively migrate to Redux, so starting now to use Redux tools on new features will make our migration faster
@dirkarnez
dirkarnez / AutoHotkeyTest.java
Created November 20, 2018 11:24 — forked from brigand/AutoHotkeyTest.java
Using AutoHotkey in a Java program
// All depends can be found here: http://apps.aboutscript.com/jhk/JHK.zip
// Video: http://youtu.be/EX0iT0NTTjw
import com.eaio.nativecall.*;
public class AutoHotkeyTest {
private static IntCall exec;
public static void main(String[] args) {
System.out.println("Hello World");
@dirkarnez
dirkarnez / goroutine-download-file.go
Created September 28, 2018 08:24 — forked from nevermosby/goroutine-download-file.go
Use goroutine to download multiple files
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
"strings"
"sync"
@dirkarnez
dirkarnez / godoc2md-all
Created June 20, 2018 07:30 — forked from eduncan911/godoc2md-all
Godoc2md for current and all sub-directories
#!/bin/bash
# bash script to create a GoLang README.md in the current and all sub-directories.
#
# installation:
# place this in your ~/bin or similar. make sure to: chmod 755 godoc2md-all
#
# it is recommended to have a doc.go for each package, that allows for samples and
# additional instructions.
#
@dirkarnez
dirkarnez / reflection.go
Created April 20, 2018 02:37 — forked from drewolson/reflection.go
Golang Reflection Example
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`