Skip to content

Instantly share code, notes, and snippets.

View AaronNGray's full-sized avatar

Aaron Gray AaronNGray

View GitHub Profile
@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();
})();
@AaronNGray
AaronNGray / gitprint.js
Created April 16, 2020 23:39 — forked from beevelop/gitprint.js
Print GitHub markdown files
document.querySelector('#readme').setAttribute('style', 'position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; background-color: white')
document.querySelector('body').appendChild(document.querySelector('#readme'))
window.print()
@AaronNGray
AaronNGray / npm_lazy.md
Created October 6, 2019 19:19
How to install npm_lazy as a Mac OS X Launcher from the command line.

How to install npm_lazy as a Mac OS X Launcher from the command line.

NOT TESTED YET

Install npm_lazy globally :-

npm install -g npm_lazy

Create the configuration file :-

How to install verdaccio as a Mac OS X Launcher from the command line.

NOT TESTED YET

Install verdaccio globally :-

npm install -g verdaccio
# /Users/user/Scripts/npm_lazy.sh
#!/bin/sh
npm_lazy --config --config ~\npm_lazy.config.js