Skip to content

Instantly share code, notes, and snippets.

@remitbri
remitbri / JS - strike letters & digits in a text.js
Last active September 30, 2015 20:57
JS - to strike letters & digits in a text
textToBeStriked.replace(/[a-zA-Z0-9À-ÿ]/g, "$&\u0336")
@remitbri
remitbri / JS - unicode char to hex value.js
Last active September 30, 2015 20:57
JS - unicode char to hex value (♥ ↔ \2665)
"♥".charCodeAt(0).toString(16)
@remitbri
remitbri / dabblet.css
Created March 21, 2012 12:32
justify in xhtml
/**
* justify in xhtml
*/
body{background: #f06; background: linear-gradient(45deg, #f06, yellow); min-height: 100%;}
p{width:85%; margin:50px auto; padding:.5em; text-align:justify; background:white; font-size:1%;}
p>*{font-size:10000;}
p:after{content:""; display:inline-block; width:100%;
font:0/0 a; margin-top:-100%; line-height:0; height:0; padding:0;}
@remitbri
remitbri / JSON - from console to clipboard.js
Created August 5, 2013 19:06
nifty formatted JSON to your clipboard (via @ryanseddon)
copy(JSON.stringify(data, null, 2))
console.log('Captain\'s Log 1', new Date());
console.info('Ammo supplies moderate');
console.debug('Shield\'s are up');
console.warn('Unidentified craft appearing');
console.error('Fire in the cargo bay');Run
console.assert(false, 'Not true'); // say 'Not True' only if 1st param === false
console.group('My group');
// …

Keybase proof

I hereby claim:

  • I am remitbri on github.
  • I am remitbri (https://keybase.io/remitbri) on keybase.
  • I have a public key whose fingerprint is B615 4337 FF39 1982 76C9 6205 CF55 6EFE 06D3 16F0

To claim this, I am signing this object:

@remitbri
remitbri / bucklescript
Last active November 21, 2018 16:33
polymorphic variant typing problem
17 ┆ jsStuff =>
18 ┆ switch (beeTypeFromJs(jsStuff)) {
>19 ┆ | Some(output) => output
20 ┆ | None => `baa
21 ┆ };
This has type:
beeType
But somewhere wanted:
stuff4
@remitbri
remitbri / KOKEN - essays-categories-list.html
Last active November 23, 2021 14:26
The aim is to list all the essays for all the categories an essay belongs to, in the context of essay.lens in a koken.me project. As of Koken v0.7.1, the solution https://gist.github.com/bradleyboy/0b4c335141bb2d22634f crashes the page. So, instead, manually, the solution below (rinse and repeat for all the categories of your project)…
<koken:categories>
<koken:loop>
<koken:if data="category.id" equals="1">
Also in <strong>{{ category.title }}</strong>
<ul>
<koken:load source="essays" filter:category="1">
<koken:loop>
<li>
<koken:link>
{{ essay.title }}