Skip to content

Instantly share code, notes, and snippets.

Leon de Rijke leonderijke

Block or report user

Report or block leonderijke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@leonderijke
leonderijke / EverySet.elm
Created Jul 3, 2017
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.
View EverySet.elm
module EverySet
exposing
( EverySet
, empty
, insert
, isEmpty
, member
, remove
)
@leonderijke
leonderijke / Avatar.js
Created Oct 14, 2016
On a Blind Date with React: Animating the Avatars
View Avatar.js
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 / MatchButton.js
Created Oct 14, 2016
On a Blind Date with React: Animating the MatchButton
View MatchButton.js
componentDidMount() {
const el = findDOMNode(this);
this._tween = TweenLite.to(el, 2, { delay: 2, opacity: 1 });
},
@leonderijke
leonderijke / MatchIntro.js
Created Oct 14, 2016
On a Blind Date with React: Animating the instructions
View MatchIntro.js
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 / Person.js
Created Oct 14, 2016
On a Blind Date with React: Animating the video slide in
View Person.js
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 / README.md
Last active Aug 12, 2019
Front Export: Little export script for exporting all conversations in a Front App inbox
View README.md

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 / svgfixer.js
Last active Sep 26, 2019
Fixes references to inline SVG elements when the <base> tag is in use.
View svgfixer.js
/**
* 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 / SassMeister-input.scss
Created Dec 4, 2014
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// 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 / uniqueColors.js
Last active Aug 29, 2015
Quick and dirty way of find unique RGB(A) colors in a CSS file.
View uniqueColors.js
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 May 15, 2014
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// 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 {
You can’t perform that action at this time.