Skip to content

Instantly share code, notes, and snippets.

Avatar
😶
Getting it together

Lu Nelson lunelson

😶
Getting it together
View GitHub Profile
View codeswing.json
{"scripts": [],"showConsole": true}
@lunelson
lunelson / input.scss
Created Nov 7, 2020
Generated by SassMeister.com.
View input.scss
@use 'sass:math';
@use 'sass:list';
@use 'sass:map';
$theme: (
breakpoints: (
s: 20em, // 320 px alt: 20,30,45,60,75,90
m: 32em, // 512 px
ml: 48em, // 768 px
l: 64em, // 1024 px
@lunelson
lunelson / usage-yn.js
Created Dec 1, 2019
Usage of npm package "yn"
View usage-yn.js
const yn = require('yn');
function confirm(message, callback) {
process.stdin.setEncoding('utf8');
process.stdin.resume();
process.stdout.write(`Confirm: ${message} [Y]`);
process.stdin.once('data', function(data) {
var ok = yn(data) || data.trim() == '';
try { callback(ok); } catch (e) { throw new Error(e); }
process.stdin.pause();
@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);
}