Skip to content

Instantly share code, notes, and snippets.

View aputs's full-sized avatar

Allan Ralph Hutalla aputs

  • Earth
  • Philippines
View GitHub Profile
@aputs
aputs / jwt.cljs
Created September 21, 2016 02:01
clojurescript JWT encode/decode (SHA version only)
(ns cljsjs.jwt
(:require
[clojure.spec :as s]
[clojure.string :as str]
[goog.json :as json]
[goog.crypt.base64 :refer [encodeString decodeString]]))
;; https://github.com/Caligatio/jsSHA
;; goog.crypt.hmac produces different signature than nodejs version
(def jssha (js/require "jssha"))
@aputs
aputs / boot.properties
Created September 29, 2016 15:10
re-natal reagent figwheel repl with boot-clj
#http://boot-clj.com
#Wed Sep 28 14:53:54 PHT 2016
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.9.0-alpha12
BOOT_VERSION=2.6.0
lvcreate --wipesignatures y -n thinpool arch -L 100G
lvcreate --wipesignatures y -n thinpoolmeta arch -L 1G
lvconvert -y --zero n -c 512K --thinpool arch/thinpool --poolmetadata arch/thinpoolmeta
cat <<EOF | tee /etc/lvm/profile/docker-thinpool.profile
activation {
thin_pool_autoextend_threshold=80
thin_pool_autoextend_percent=20
}
@aputs
aputs / create-smartos-vm.sh
Created November 20, 2016 20:54 — forked from twobitfool/create-smartos-vm.sh
Create a SmartOS VM in VirtualBox
#!/bin/sh
#
# Creates a SmartOS VM in VirtualBox (assuming you alread have VirtualBox installed)
#
# This script will:
# * Download the latest live ISO image of SmartOS
# * Create a VirtualBox VM, or update an existing VM with the latest ISO
# * Configure the VM with a zones disk, and boot it!
#
#
@aputs
aputs / redis_sentinel.py
Created September 15, 2018 05:41
add support for redis sentinel on django-redis
# -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from redis.sentinel import Sentinel
from django_redis.client import DefaultClient
@aputs
aputs / devserver.py
Last active September 10, 2019 11:59
django runserver with asyncio
"""
replacement runserver for django with asyncio support
"""
import errno
import os
import sys
import socket
import asyncio
import aiomonitor
@aputs
aputs / keybindings.json
Last active November 10, 2019 13:15
windows vscode keybindings for terminal resizing
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+shift+j",
"command": "workbench.action.toggleMaximizedPanel"
},
{
"key": "ctrl+shift+down",
"command": "workbench.action.terminal.resizePaneDown",
"when": "terminalFocus"
@aputs
aputs / settings.json
Last active November 10, 2019 13:14
windows vscode user settings
{
"workbench.colorTheme": "Material Theme Darker High Contrast",
"vim.easymotion": true,
"vim.sneak": true,
"vim.incsearch": true,
"vim.useSystemClipboard": true,
"vim.useCtrlKeys": true,
"vim.hlsearch": true,
"vim.insertModeKeyBindings": [
{
@aputs
aputs / settings.json
Last active November 13, 2019 06:13
osx vscode settings.json
{
"terraform.indexing": {
"enabled": true,
"liveIndexing": false,
"delay": 500,
"exclude": [
".terraform/**/*",
"**/.terraform/**/*",
"**/bazel-**/*"
]
@aputs
aputs / .gitconfig
Last active November 28, 2019 14:15
.myconfig
[user]
name = Allan Ralph Hutalla
email = ahutalla@gmail.com
[alias]
ci=commit
co=checkout
br=branch
di=diff
st=status