Skip to content

Instantly share code, notes, and snippets.

😶
Getting it together

Lu Nelson lunelson

😶
Getting it together
Block or report user

Report or block lunelson

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
@lunelson
lunelson / sync-to-frames.js
Created Aug 15, 2019
Pattern for syncing rapid events to the AF loop
View sync-to-frames.js
function syncToFrames(el, eventName, frameCB, postFrameCB) {
let active = false;
function deactivate() { active = false; }
function activate() {
if (!active) {
setTimeout(onPostFrame);
requestAnimationFrame(onFrame);
@lunelson
lunelson / js2sass.js
Last active Aug 2, 2019
JS2Sass: parse JS values to Sass values
View js2sass.js
const parseUnit = require('parse-unit');
const colorString = require('color-string');
// this function can receive either dart-sass or node-sass as sassEngine
module.exports = function(sassEngine) {
return function js2sass(jsValue) {
// UnitNumber | Color | String
if (typeof jsValue === 'string') {
const unitNumber = parseUnit(jsValue);
View keybase.md

Keybase proof

I hereby claim:

  • I am lunelson on github.
  • I am lunelson (https://keybase.io/lunelson) on keybase.
  • I have a public key ASCsx1FnyD0wK6eqcYAapRm9Yq-nZFYAbZU7ZPux2J-Vewo

To claim this, I am signing this object:

@lunelson
lunelson / karabiner.json
Created Sep 1, 2017
Karabiner Elements Caps Lock to HYPER config
View karabiner.json
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@lunelson
lunelson / test.scss
Created Apr 27, 2016
true failing on use of calll()
View test.scss
@function foo($a,$b,$c) {
@return $a $b $c;
}
.test {
$list: 1 2 3;
out: foo(1,2,3);
out: foo($list...);
out: call(foo, $list...);
out: call(join(foo, $list)...);
@lunelson
lunelson / SassMeister-input.scss
Created Mar 17, 2016 — forked from anonymous/SassMeister-input.scss
String interpolation bug, libsass 3.3.3
View SassMeister-input.scss
// ----
// libsass (v3.3.2)
// ----
@function slice($list, $start: 1, $end: length($list), $sep: list-separator($list)) {
$output: ();
@if $start >= 1 and $end >= $start {
@for $i from $start through $end {
$output: append($output, nth($list, $i), $sep);
}
@lunelson
lunelson / SassMeister-input.scss
Created Feb 23, 2016
Parsing selectors out of strings...
View SassMeister-input.scss
// ----
// Sass (v4.0.0.alpha.1)
// ----
/*
SKETCHES FOR SELECTOR MANIPULATION
mixins
@mixin adjacent-to()
@lunelson
lunelson / SassMeister-input.scss
Created Jan 29, 2016
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v4.0.0.alpha.1)
// MathSass (v0.9.5)
// ----
@import "math";
@function mod-scale($base, $exp, $spread) {
@return pow($base, $exp / $spread);
}
@lunelson
lunelson / SassMeister-input.scss
Last active Jan 28, 2016
sketches for modular margin revival, sass-alpha
View SassMeister-input.scss
// ----
// Sass (v4.0.0.alpha.1)
// ----
@mixin foo($opts: null, $bar: 1, $baz: 2, $bif: 3) {
@if $opts { @include foo($opts...); } @else {
bar: $bar;
baz: $baz;
bif: $bif;
}
@lunelson
lunelson / SassMeister-input.scss
Last active Jan 26, 2016
mixin option-map pattern
View SassMeister-input.scss
// ----
// Sass (v4.0.0.alpha.1)
// ----
@mixin foo($opts: null, $bar: 1, $baz: 2, $bif: 3) {
@if $opts { @include foo($opts...); } @else {
bar: $bar;
baz: $baz;
bif: $bif;
}
You can’t perform that action at this time.