Skip to content

Instantly share code, notes, and snippets.

View leok7v's full-sized avatar

Leo Kuznetsov leok7v

View GitHub Profile
@leok7v
leok7v / vigil.h
Created September 27, 2021 01:13
better assert() with optional format and varadic args
#pragma once /* Copyright (c) Dmitry "Leo" Kuznetsov 2021 see LICENSE for details */
#include <assert.h> // to prevent further redefinition of assert
// better assert(0 <= i && i < n, "index i=%d out of [0..%d( range", i, n);
// also available as 'swear' and 'implore' instead of assert()
// see: https://github.com/munificent/vigil
#undef assert
#if defined(_DEBUG) || defined(DEBUG) || defined(ASSERT_IN_NDEBUG)
@leok7v
leok7v / build-apk.bash
Last active August 11, 2024 03:29
Single file bash script to build Android Hello World apk (target API=21) on osx
#!/bin/bash
# https://medium.com/@authmane512/how-to-build-an-apk-from-command-line-without-ide-7260e1e22676
# dependencies:
# https://installvirtual.com/install-openjdk-8-on-mac-using-brew-adoptopenjdk/
# brew updata
# brew tap AdoptOpenJDK/openjdk
# brew cask install adoptopenjdk8
# https://developer.android.com/ndk/downloads
# https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip
# and use:
@ww9
ww9 / gist_markdown_examples.md
Last active November 1, 2024 11:49
Gist markdown examples

Gist markdown examples

A collection of Markdown code and tricks that were tested to work in Gist.

This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.

Todo

  • Reformat this whole document and assimilate these: