Skip to content

Instantly share code, notes, and snippets.

@Coridyn
Coridyn / LazyTippy.jsx
Created February 9, 2023 02:10 — forked from atomiks/LazyTippy.jsx
Lazy Tippy
// Will only render the `content` or `render` elements if the tippy is mounted to the DOM.
// Replace <Tippy /> with <LazyTippy /> component and it should work the same.
const LazyTippy = forwardRef((props, ref) => {
const [mounted, setMounted] = useState(false);
const lazyPlugin = {
fn: () => ({
onMount: () => setMounted(true),
onHidden: () => setMounted(false),
@Coridyn
Coridyn / info.md
Created September 24, 2017 03:17
Webpack + TypeScript + Vue

2017-09-24

Build Vue with template compiler

Make sure you have the vue$ alias in webpack.config.js:

{
    resolve: {
 alias: {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<script>
document.addEventListener('DOMContentLoaded', function(){
document.querySelector('#frame').srcdoc = document.querySelector('#frameContent').innerHTML;
@Coridyn
Coridyn / sassc-ruby windows installation.md
Last active September 26, 2018 12:58
How to compile and install the sassc-ruby gem on Windows

Windows installation

This will install SassC Ruby gem on Windows.

  1. Download and install Ruby 2 (http://rubyinstaller.org/downloads/)
  2. Download and install the ruby development kit (http://rubyinstaller.org/downloads/) (for the rest of the document, assuming it's installed into c:\devkit\)
  3. Download the libdl library for Windows (https://github.com/dlfcn-win32/dlfcn-win32) Go to releases and download the most recent precompiled version.
  4. Extract the libdl package into your development kit mingw directory:
var XHR = window.XMLHttpRequest || function() {
try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e1) {}
try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e2) {}
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e3) {}
try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e4) {}
throw new Error("This browser does not support XMLHttpRequest.");
}, XDR = !window.msPerformance && isIE () != 10 && window.XDomainRequest || null;
/**
Install Ruby:
https://rvm.io/rvm/install
Install node with homebrew:
http://thechangelog.com/install-node-js-with-homebrew-on-os-x/
Turn on colours in iTerm2
http://superuser.com/questions/399594/color-scheme-not-applied-in-iterm2
@Coridyn
Coridyn / PixelBender-XOR.pbk
Created September 9, 2014 02:22
Bitwise XOR two images in PixelBender
<languageVersion : 1.0;>
kernel Crossfade
< namespace : "AIF";
vendor : "Coridyn - https://github.com/Coridyn";
version : 2;
description : "Perform a bitwise XOR of two images"; >
{
input image4 inputImage;
input image4 diffImage;
@Coridyn
Coridyn / ui-bootstrap-tabs-edited-0.10.0.js
Created May 13, 2014 13:47
A cut-down version of the ui-bootstrap tab component - this fixes the transclusion of tab header content.
/*
* angular-ui-bootstrap
* http://angular-ui.github.io/bootstrap/
* Version: 0.10.0 - 2014-05-05
* License: MIT
*/
angular.module("ui.bootstrap", ["ui.bootstrap.tpls", "ui.bootstrap.tabs"]);
angular.module("ui.bootstrap.tpls", ["template/tabs/tab.html","template/tabs/tabset.html"]);
var methodColors = {
identify: "#c66",
track: "#66c",
pageview: "#c6c",
_default: "#888"
};
function log(method, objects) {
var color = methodColors[method] || methodColors._default;
var args = ['%c Segment.io %c '+method+' ','background: #6c6; color: white;', 'background: '+color+'; color: white;'];