Skip to content

Instantly share code, notes, and snippets.

View zacharycarter's full-sized avatar
👋
Howdy!

Tail Wag Games zacharycarter

👋
Howdy!
View GitHub Profile
@zacharycarter
zacharycarter / sigv4.nim
Created March 20, 2018 15:59 — forked from Varriount/sigv4.nim
Optimized sigv4.nim
#[
# AWS SignatureV4 Authorization Library
Implements functions to handle the AWS Signature v4 request signing
http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html
]#
import os, times
import strutils except toLower
import sequtils, algorithm, tables, nimSHA2
import securehash, hmac, base64, re, unicode
@zacharycarter
zacharycarter / aws_example.nim
Created March 20, 2018 15:59 — forked from Varriount/aws_example.nim
Nim AWS Snippets
# AWS Version 4 signing example
# EC2 API (DescribeRegions)
# See: http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html
# This version makes a GET request and passes the signature
# in the Authorization header.
import base64, httpclient, hmac, nimSHA2, os, times, strutils, httpcore
# ************* REQUEST VALUES *************
{.experimental.}
type Refcounted = ref object
rc: int
value: int
type A = object
r: Refcounted
proc newA(value: int): A =
@zacharycarter
zacharycarter / orthodoxc++.md
Created October 20, 2018 03:47 — forked from bkaradzic/orthodoxc++.md
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

import asyncdispatch
import asynctools
import docopt
import json
import nre
import os
import ospaths
import sequtils
import sha256/sha256sum
import strutils
/* clang-format off */
/*
ijss : IncredibleJunior SparseSet
sparse set [1] for bookkeeping of dense<->sparse index mapping or
a building block for a simple LIFO index/handle allocator
[1] https://research.swtch.com/sparse
*/