Skip to content

Instantly share code, notes, and snippets.

View strainer's full-sized avatar
💭
hacking time

Andrew Strain strainer

💭
hacking time
  • UK
View GitHub Profile
@strainer
strainer / makefile
Last active May 9, 2023 01:00
theme property resets for scite darkmode
th.indentguide=#a9a9ff
th.braceinc=#ae3535
th.bracehi=#86581b
th.almostwhite=#f9f9f9
th.mildblue2=#474179
th.linebac=#f0f0f0
th.toad=#92923c
# Global default styles for all languages
#root style 32
@strainer
strainer / scint.cxx
Last active May 18, 2023 23:39
theme inversion for scite
constexpr Scintilla::Colour InvertLight(Scintilla::Colour c) noexcept {
// Integer calcs done at x16 (0..4080 + 8) 0 => 0..15 255 => 4080..4095
int R = 8 + 16 * ( c & 0xffU );
int G = 8 + 16 * ( (c >>8) & 0xffU );
int B = 8 + 16 * ( (c >>16) & 0xffU );
const int rw = 18, gw = 35, bw = 11; // Brightness factors (compromised)
const int lumTrast = -64;
@strainer
strainer / antisort_index.js
Created August 24, 2018 01:22
monster function
function aindex(mx,Ai,sq,sep,lim,x){ //Sorry but its working....
var Av,i
if( typeof mx !=='boolean')
{ x=lim,lim=sep,sep=sq,sq=Ai,Ai=mx,mx=true }
if( typeof Ai !=='object' || (isNaN(parseFloat(Ai[0])) || !isFinite(Ai[0]))
||(typeof sep ==='string' && sep==="pos")){
Av= new Array((Ai>0)?Ai:Ai.length)
if( typeof sq ==='undefined') sq=1
if(sep ==="pos"){ sep=lim,lim=x }
for( i=0;i<Av.length;i++ ) Av[i]=i