Skip to content

Instantly share code, notes, and snippets.

View kevinadi's full-sized avatar

Kevin Adistambha kevinadi

  • MongoDB
  • Sydney, Australia
View GitHub Profile
@kevinadi
kevinadi / mgeneratejs.template.json
Created May 22, 2018 04:25
mgeneratejs template
{
"numbers": {
"integer": "$integer",
"float": "$floating"
},
"array": {
"$array": {
"of": {
"$country": {
"full": true
@kevinadi
kevinadi / build.gradle
Created August 13, 2018 01:33
Basic build.gradle with fat jar capability
plugins {
id 'java'
id 'application'
}
mainClassName = 'App'
dependencies {
testCompile 'junit:junit:4.12'
}
@kevinadi
kevinadi / init.el
Last active September 17, 2025 00:53
Reasonable init.el using builtins only
(require 'package)
;;; Code:
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
@kevinadi
kevinadi / Makefile
Created June 27, 2019 01:42
Makefile for Go to automatically stamp Git info and build date
version=$(shell git describe --always --long --dirty)
date=$(shell date -j "+(%b %Y)")
all:
@go build -v -ldflags '-X "main.version=${version}" -X "main.date=${date}"'
install:
@go install -v -ldflags '-X "main.version=${version}" -X "main.date=${date}"'
@kevinadi
kevinadi / async_await_setTimeout.js
Created June 27, 2019 05:48
Promisifying and awaiting setTimeout
function sleep(ms) {
return new Promise((resolve, reject) => {
console.log(`Sleeping for ${ms} ms...`)
setTimeout(() => resolve('Done sleeping'), ms)
})
}
const run = async function() {
console.log('Run start')
const res = await sleep(2000)
@kevinadi
kevinadi / init.el
Created September 17, 2025 00:54
Basic init.el
;;; -*- lexical-binding: t -*-
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-enabled-themes '(leuven-dark))
'(fido-mode t)
'(fido-vertical-mode t)
'(global-display-line-numbers-mode t)