Skip to content

Instantly share code, notes, and snippets.

View AaronNGray's full-sized avatar

Aaron Gray AaronNGray

View GitHub Profile
#!/usr/bin/env bash
if [ ! `which jq` ]
then
echo Installing 'jq'
sudo apt-get install jq -y
fi
set -euo pipefail
#!/usr/bin/env bash
# webfinger
if [ ! `which jq` ]
then
echo Installing 'jq'
sudo apt-get install jq -y
fi
set -euo pipefail
@AaronNGray
AaronNGray / instanceof.ts
Created September 21, 2023 04:33
instanceof.ts
abstract class A {
abstract run(): Promise<void>
}
export class B implements A {
async run(): Promise<void> {
}
}
const I = new B();
@AaronNGray
AaronNGray / qt-everywhere-opensource-src-5.15.9
Created August 29, 2023 19:38
qt-everywhere-opensource-src-5.15.9
tar xf ~/Downloads/qt-everywhere-opensource-src-5.15.9.tar.xz
cd qt-everywhere-src-5.15.9
mkdir build
cd build
../configure
make
sudo make install
@AaronNGray
AaronNGray / bitset lookahead-ANDNZ.cpp
Created January 6, 2023 20:15
lookahead bitset guard - ANDNZ
#include <cstddef>
#include <initializer_list>
template<size_t BITS>
class bitset
{
public:
bitset() : sizeInBits(BITS), sizeOfWord(sizeof(WORD) * 8), sizeInWords((BITS + (sizeof(WORD) * 8) - 1) / (sizeof(WORD) * 8)) {
for (size_t i = 0; i < sizeInWords; ++i)
data[i] = 0;
@AaronNGray
AaronNGray / gist:dd227dcab6ec917152be0e6677a02939
Created January 6, 2023 20:13
lookahead bitset-ANDNZ.cpp
#include <cstddef>
#include <initializer_list>
template<size_t BITS>
class bitset
{
public:
bitset() : sizeInBits(BITS), sizeOfWord(sizeof(WORD) * 8), sizeInWords((BITS + (sizeof(WORD) * 8) - 1) / (sizeof(WORD) * 8)) {
for (size_t i = 0; i < sizeInWords; ++i)
data[i] = 0;
@AaronNGray
AaronNGray / storm.yaml
Created February 15, 2021 21:30
Attempt at Storm+ZooKeeper+ElasticSearch+Kibana
version: '3.2'
services:
zookeeper:
image: zookeeper
container_name: zookeeper
restart: always
nimbus:
image: storm:1.2.3
@AaronNGray
AaronNGray / README.md
Created February 10, 2021 12:28
Storm version 1.2.3 Docker Compose Container

Docker yaml script for Zookeeper, Storm v1.2.3 nimbus, supervisor, and UI.

docker-compose -f storm-1.2.3.yaml pull
docker-compose -f storm-1.2.3.yaml start
docker-compose -f storm-1.2.3.yaml stop
@AaronNGray
AaronNGray / js-exif-rotate.html
Created August 5, 2020 17:29 — forked from runeb/js-exif-rotate.html
Auto-rotate images locally in the browser by parsing exif data
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<input id="file" type="file" accept="image/*" />
<br/>
<h2>As read:</h2>
<img id="placeholder1" width=300/><br/>
<h2>Rotated by exif data:</h2>
<img id="placeholder2" width=300/>
<script>
@AaronNGray
AaronNGray / github-markdown-print.js
Created April 16, 2020 23:41 — forked from hangxingliu/github-markdown-print.js
GitHub Markdown Print Script
// Refrence from: https://gist.github.com/beevelop/a0f2c76e79610dca01550c9a93f83876
// Copy following scripts in the developer console of page included markdown content you want to print:
(function () {
var $ = document.querySelector.bind(document);
$('#readme').setAttribute('style', 'position:absolute;top:0;left:0;right:0;bottom:0;z-index:100;background-color:white');
$('#readme>article').setAttribute('style', 'border: none');
$('body').innerHTML = $('#readme').outerHTML;
window.print();
})();