Skip to content

Instantly share code, notes, and snippets.

View leonderijke's full-sized avatar

Leon de Rijke leonderijke

  • Eindhoven, the Netherlands
View GitHub Profile
@leonderijke
leonderijke / SassMeister-input.scss
Created May 15, 2014 11:41
Generated by SassMeister.com.
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
// Fork of http://sassmeister.com/gist/8760275 by @jlong
@function slice($list, $start: 1, $end: length($list)) {
$result: ();
@for $i from $start through $end {
@leonderijke
leonderijke / uniqueColors.js
Last active August 29, 2015 14:10
Quick and dirty way of find unique RGB(A) colors in a CSS file.
var _ = require("lodash");
var fs = require("fs");
var parser = require("css");
var file = fs.readFileSync("./css/pagedetail.css", "utf-8").toString();
var parsed = parser.parse(file);
var uniqueColors = _.chain(parsed.stylesheet.rules)
// Get declarations for each rule
@leonderijke
leonderijke / SassMeister-input.scss
Created December 4, 2014 15:18
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
$pi: 3.14159265359;
@function pow($base,$exp){
$value: $base;
@if $exp > 1{
@for $i from 2 through $exp{
@leonderijke
leonderijke / svgfixer.js
Last active May 26, 2023 11:22
Fixes references to inline SVG elements when the <base> tag is in use.
/**
* SVG Fixer
*
* Fixes references to inline SVG elements when the <base> tag is in use.
* Firefox won't display SVG icons referenced with
* `<svg><use xlink:href="#id-of-icon-def"></use></svg>` when the <base> tag is on the page.
*
* More info:
* - http://stackoverflow.com/a/18265336/796152
* - http://www.w3.org/TR/SVG/linking.html
@leonderijke
leonderijke / README.md
Last active January 19, 2023 15:18
Front Export: Little export script for exporting all conversations in a Front App inbox

Front export

✋ Heads up! This code uses the Front API V1, which is deprecated. @niklasravnsborg took this project further and created a Front API V2 compatible version: https://github.com/niklasravnsborg/front-export 🎉

Little export script for exporting all conversations in a Front inbox, using the Front API.

When using the awesome Front App, you want to export all conversations in an inbox. For example, for backup purposes.

Three environment variables are needed:

@leonderijke
leonderijke / Person.js
Created October 14, 2016 08:35
On a Blind Date with React: Animating the video slide in
componentDidMount() {
const el = findDOMNode(this);
// Determine if we should animate from the left or from the right
const percentage = this.props.direction === 'left' ? -100 : 100;
this._tl = new TimelineLite({ paused: true });
// Force full width, because our parent element is a Flex item. Otherwise,
// we wouldn't get enough width from the flexbox algorithm.
this._tl.set(el, { width: '100%' });
@leonderijke
leonderijke / MatchIntro.js
Created October 14, 2016 09:10
On a Blind Date with React: Animating the instructions
componentDidMount() {
this._tl = new TimelineLite({ paused: true });
// Fade out the content and set it to `visibility: hidden`
// See: http://greensock.com/docs/#/HTML5/GSAP/Plugins/CSSPlugin/
this._tl.to(this._contentEl, 0.5, { autoAlpha: 0 });
// Shrink it down to zero width
this._tl.to([el, this._contentEl], 0.5, { width: 0, padding: 0 });
// Hide it completely so it's not considered in the flexbox
// layout algorithm anymore
@leonderijke
leonderijke / MatchButton.js
Created October 14, 2016 09:14
On a Blind Date with React: Animating the MatchButton
componentDidMount() {
const el = findDOMNode(this);
this._tween = TweenLite.to(el, 2, { delay: 2, opacity: 1 });
},
@leonderijke
leonderijke / Avatar.js
Created October 14, 2016 10:15
On a Blind Date with React: Animating the Avatars
componentDidMount() {
this._tl = new TimelineLite({ paused: true });
this._tl.add([
// Fade out the Avatar Info (name and background)
TweenLite.to(this._infoEl, 0.5, { opacity: 0, width: 0, margin: 0 }),
// Scale down the Avatar image
TweenLite.to(this._figureEl, 0.5, { scale: 0.75 })
]);
@leonderijke
leonderijke / EverySet.elm
Created July 3, 2017 11:40
EverySet: Set wrapper for using union types in a Set, using `toString` as a hashing function. Can only be used on type that can be stringified.
module EverySet
exposing
( EverySet
, empty
, insert
, isEmpty
, member
, remove
)