Skip to content

Instantly share code, notes, and snippets.

View sn3p's full-sized avatar

Matthijs Kuiper sn3p

View GitHub Profile
@sn3p
sn3p / markdown.css
Last active July 28, 2023 10:42 — forked from imjasonh/markdown.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@sn3p
sn3p / SassMeister-input.scss
Created July 2, 2015 10:12
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
%file-links {
%style {
&::before {
background: no-repeat center;
content: "";
@sn3p
sn3p / index.html
Last active May 18, 2019 05:50
Gist for blog post "Customizing the Intercom Launcher" http://blog.learningspaces.io/customizing-the-intercom-launcher
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Inject a stylesheet into the iframe</title>
<link rel="stylesheet" href="intercom.css">
</head>
<script>
// IMPORTANT: Make sure to change YOUR_APP_ID
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true; s.src='https://widget.intercom.io/widget/YOUR_APP_ID'; var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()
@sn3p
sn3p / index.html
Last active February 25, 2018 18:14
Gist for blog post "Customizing the Intercom Launcher" http://blog.learningspaces.io/customizing-the-intercom-launcher
<a class="intercom-launcher" href="mailto:YOUR_APP_ID@incoming.intercom.io">
<div class="intercom-icon-close"></div>
<div class="intercom-icon-open"></div>
<span class="intercom-unread-count"></span>
</a>
@sn3p
sn3p / favicon.js
Created February 8, 2017 17:24
Dynamic favicon with count badge
// Usage:
// <link rel="shortcut icon" href="favicon.png" data-count"5">
(() => {
const faviconSize = 32;
const favicon = document.querySelector('[data-count]')
// No notifications
if (!favicon || !favicon.dataset.count) {
return;
@sn3p
sn3p / README.md
Last active August 14, 2019 14:26
Test Elixir/Phoenix templates in JavaScript

Test EEx template in JavaScript

This example renders an Elixir/Phoenix EEx template in a JavaScript tests. I'm using cell-js and ex_css_modules to scope JS/CSS.

Rendering the template works like a charm. But when using CSS Modules the scoped classnames mapping (style.css.json file) needs to be present, otherwise rendering the template errors.

mocha test/**/*_test.js --recursive --require test/test_setup.js --timeout 10000

Keybase proof

I hereby claim:

  • I am sn3p on github.
  • I am sn3p (https://keybase.io/sn3p) on keybase.
  • I have a public key ASB1uGKpDI72UI0Cm4UbCdqLwYqYz6VzBV2O3nOm8iGq2wo

To claim this, I am signing this object: