Skip to content

Instantly share code, notes, and snippets.

View kvanbere's full-sized avatar
:octocat:
We write and test real time control software. @cuedo

Kyle Van Berendonck kvanbere

:octocat:
We write and test real time control software. @cuedo
View GitHub Profile
class ScriptFoldHandler {
constructor(nonce) {
this.nonce = nonce
//
this.aboveFoldScripts = []
this.aboveFoldReady = new Promise((resolve, reject) => {
this.resolveAboveFoldScripts = resolve
})
}
@kvanbere
kvanbere / cuedo.com.au.md
Created September 25, 2020 21:18
ONROCK Online Rebranding

Hey,

As many of you know, I do a lot of jobs on the side in the area of web design, programming, email and small business infrastructure, search engine optimisation, general IT, etc.

I’ve rebranded my company with a brand new identity and we’re upscaling. Would love if you could follow us on the website or Instagram for the journey as well.

Cuedo Business Solutions

Cheers 🥂

Contents

@kvanbere
kvanbere / fixsvg.js
Created January 5, 2018 23:23
Paste in the terminal with the svg open, then inspector -> view as HTML and copy result out
classMap = {}
var rules = document.styleSheets[0].cssRules // 1. get first stylesheet
for (var j = 0; j < rules.length; j++) { // 2. loop over all rules
var selector = rules[j].selectorText
var csstext = rules[j].cssText
classMap[selector.replace(".", "")] = csstext.split("{")[1].replace("}", "") // 3. save class name and rule text to mapper object
}
document.querySelectorAll("rect,path,polygon,image").forEach(function(item, index) { // 4. loop over all rects
var style = ""
@kvanbere
kvanbere / .sh
Created December 18, 2017 09:32
stack install cabal2nix --extra-include-dirs=/usr/local/opt/openssl/include --extra-lib-dirs=/usr/local/opt/openssl/lib
Process exited with code: ExitFailure 1
Logs have been written to: /Users/kvanb/git/some-repo/.stack-work/logs/hopenssl-2.2.1.log
[1 of 2] Compiling Main ( /private/var/folders/bj/fmlb9nv10yvf3h7m2vsh_5m80000gn/T/stack74736/hopenssl-2.2.1/Setup.hs, /private/var/folders/bj/fmlb9nv10yvf3h7m2vsh_5m80000gn/T/stack74736/hopenssl-2.2.1/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/Main.o )
[2 of 2] Compiling StackSetupShim ( /Users/kvanb/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /private/var/folders/bj/fmlb9nv10yvf3h7m2vsh_5m80000gn/T/stack74736/hopenssl-2.2.1/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/StackSetupShim.o )
Linking /private/var/folders/bj/fmlb9nv10yvf3h7m2vsh_5m80000gn/T/stack74736/hopenssl-2.2.1/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/setup ...
Configuring hopenssl-2.2.1...
setup: Missing dependency on a foreign library:
* Missing (or bad) header file: openssl/evp.h
This problem can usually be solved by installing the system package
@kvanbere
kvanbere / .sh
Created December 18, 2017 08:30
$ clang -Wall test.c
test.c:14:3: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
safelyPrintImportant(NULL);
^ ~~~~
test.c:8:39: note: callee declares array parameter as static here
void safelyPrintImportant(important_t imp[static 1]) {
^ ~~~~~~~~~~
$ clang --version
@kvanbere
kvanbere / .hs
Created December 15, 2017 10:29
f :: Int -> Int
f (I# x) = I# (x +# x +# x)
@kvanbere
kvanbere / .hs
Created December 15, 2017 10:28
f :: Int -> Int
f x = x + x + x
f :: Int -> Int
f x = case x of { I# z -> I# (plus_Retn2 (plus_Retn2 z z) z) }
@kvanbere
kvanbere / .hs
Created December 15, 2017 10:27
-- Specialization of return
plus_Retn :: Int -> Int -> Int#
plus_Retn (I# a) (I# b) = a +# b
(+) :: Int -> Int -> Int
a + b = I# (plus_Retn a b)
-- Specialization of arguments
plus_Retn2 :: Int# -> Int# -> Int#
plus_Retn2 a b = a +# b