Skip to content

Instantly share code, notes, and snippets.

View justinbowes's full-sized avatar
πŸ’­
I may be slow to respond.

Justin Bowes justinbowes

πŸ’­
I may be slow to respond.
View GitHub Profile
/*
* An implementation of C11 stdatomic.h directly borrowed from FreeBSD
* (original copyright follows), with minor modifications for
* portability to other systems. Works for recent Clang (that
* implement the feature c_atomic) and GCC 4.7+; includes
* compatibility for GCC below 4.7 but I wouldn't recommend it.
*
* Caveats and limitations:
* - Only the ``_Atomic parentheses'' notation is implemented, while
* the ``_Atomic space'' one is not.
@justinbowes
justinbowes / rui_test.h
Last active October 31, 2015 03:23
RUI test harness. C99, MSVC/GCC/Clang, standalone tests.
//
// rui_test.h
// Quanta
//
// Created by Justin Bowes on 2014-11-06.
// Copyright (c) 2014 Informi Software Inc. All rights reserved.
//
#ifndef rui_test__B2BD1D7_F65A_4026_B67F_437E3C640A18_h
#define rui_test__B2BD1D7_F65A_4026_B67F_437E3C640A18_h
@justinbowes
justinbowes / aes256.bookmarklet.html
Last active July 17, 2018 16:14
AES256 encrypt/decrypt bookmarklet
<!DOCTYPE html>
<html>
<body>
<h2>Drag link to bookmarks bar</h2>
<a href='javascript:(function(e){const t={split(e){const t=[];for(let r=0;r<e.length;){const n=e.charCodeAt(r);let o;n>=55296&&n<=56319?(o=(n-55296<<10)+(e.charCodeAt(r+1)-56320+65536),r+=2):(o=n,++r),t.push(String.fromCodePoint(o))}return t},encode(e){const t=5-e.length %25 5;let r="";e=String.fromCharCode(t)+"\0".repeat(t-1)+e;for(let t=0;t<e.length;t+=5){let o=e.substr(t,5).split("").map(n).reduce((e,t)=>256*e+t,0);for(let e=0;e<4;++e){const e=o %25 1024;o=Math.floor(o/1024),r+=this.map[e]}}return r},decode(e){const t=this.split(e);let r="";for(let e=0;t.length;++e){let n=[];for(;n.length<4;)n.unshift(this.map.indexOf(t.shift()));let o=n.reduce((e,t)=>1024*e+t,0),l="";for(let t=0;t<5;++t){let r=o %25 256;o=Math.floor(o/256),l=String.fromCharCode(r)+l,0==e&&4==t&&(l=l.substring(r))}r+=l}return r}};t.map=t.split("β™ˆβ™‰β™Šβ™‹β™Œβ™β™Žβ™β™β™‘β™’β™“βš›β›“β›”πŸ„°πŸ„±πŸ„²πŸ„³πŸ„΄πŸ„΅πŸ„ΆπŸ„·πŸ„ΈπŸ„ΉπŸ„ΊπŸ„»πŸ„ΌπŸ„½πŸ„ΎπŸ„ΏπŸ…€πŸ…πŸ…‚πŸ…ƒπŸ…„πŸ……πŸ…†πŸ…‡πŸ…ˆπŸ…‰πŸ…πŸ…‘πŸ…’πŸ…“πŸ…”πŸ…•πŸ…–πŸ…—πŸ…˜πŸ…™πŸ…šπŸ…›πŸ…œπŸ…πŸ…žπŸ…ŸπŸ… πŸ…‘πŸ…’πŸ…£πŸ…€πŸ…₯πŸ…¦πŸ…§πŸ…¨πŸ…©πŸ†ŽπŸ†πŸ†‘πŸ†’πŸ†“πŸ†”πŸ†•πŸ†–πŸ†—πŸ†˜πŸ†™πŸ†šπŸŒ€πŸŒπŸŒ‚πŸŒƒπŸŒ„πŸŒ…πŸŒ†πŸŒ‡πŸŒˆπŸŒ‰πŸŒŠπŸŒ‹πŸŒŒπŸŒπŸŒŽπŸŒπŸŒπŸŒ‘πŸŒ’πŸŒ“πŸŒ”πŸŒ•πŸŒ–πŸŒ—πŸŒ˜πŸŒ™πŸŒšπŸŒ›πŸŒœπŸŒπŸŒžπŸŒŸπŸŒ πŸŒ‘πŸŒ€πŸŒ₯🌦🌧🌨🌩πŸŒͺ🌫🌬
@justinbowes
justinbowes / .block
Last active January 14, 2020 08:49
pictogram scratch
license: mit