Skip to content

Instantly share code, notes, and snippets.

View long-lazuli's full-sized avatar
🍃
no direction home

Long Lazuli long-lazuli

🍃
no direction home
View GitHub Profile
* { &, &:before, &:after { box-sizing: border-box; } }
a { &, &:focus, &:active { color: inherit; text-decoration: inherit; } }
@long-lazuli
long-lazuli / .csscomb.json
Created February 9, 2015 17:29
My CSSComb configuration file.
{
// Full list of supported options and acceptable values can be found here:
// https://github.com/csscomb/csscomb.js/blob/master/doc/options.md
"config": {
// Whether to add a semicolon after the last value/mixin.
"always-semicolon": true,
// Set indent for code inside blocks, including media queries and nested rules.
"block-indent": " ",
@long-lazuli
long-lazuli / gulpfile.js
Created August 4, 2015 14:17
my web-app starter
var browserSync = require('browser-sync').create();
var gulp = require('gulp');
var del = require('del');
var concat = require('gulp-concat'),
filesize = require('gulp-filesize'),
gutil = require('gulp-util'),
order = require('gulp-order');
rename = require('gulp-rename'),
sass = require('gulp-sass'),
// Production steps of ECMA-262, Edition 6, 22.1.2.1
// Reference: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from
if (!Array.from) {
Array.from = (function () {
var toStr = Object.prototype.toString;
var isCallable = function (fn) {
return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
};
var toInteger = function (value) {
var number = Number(value);
@long-lazuli
long-lazuli / _inputRange.shadowDomSelector.scss
Created August 19, 2015 20:20
INPUT[type='range'] Shadow Elements Selectors
/*
* INPUT[type='range'] Shadow Elements Selectors
* ============================================= *
http://codepen.io/long-lazuli/pen/WbyqKg *
*/
$defaultBrowserList : webkit, moz, ms !default;
// this function will be used in all this script.
@function _contains(/* List */ $haystack, /* Any */ $needle) {
@if index($haystack, $needle){
Atom Editor Configuration
@long-lazuli
long-lazuli / Atom.status-ignored_files-order.less
Last active April 16, 2016 14:55
Atom: Put the ignored files (`.gitignore`) at the bottom of directory lists.
.list-tree {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
> .status-ignored {
// should probably be in a variable :
order: 10;
}
}
@long-lazuli
long-lazuli / isogram.js
Created December 26, 2016 22:44
Google Analytics ISOGRAM,
(function(_1_,_2_,_3_,_4_,_5_,_6_,_7_){_1_['GoogleAnalyticsObject']=_5_;_1_[_5_]=_1_[_5_]||function(){
(_1_[_5_].q=_1_[_5_].q||[]).push(arguments)},_1_[_5_].l=1*new Date();_6_=_2_.createElement(_3_),
_7_=_2_.getElementsByTagName(_3_)[0];_6_.async=1;_6_.src=_4_;_7_.parentNode.insertBefore(_6_,_7_)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '__YOURKEY__', 'auto');
ga('send', 'pageview');
@long-lazuli
long-lazuli / ckeditorTemplateFromJsx.js
Last active November 23, 2017 14:07
JSX to CKEditor5 Template
// Use `vdom` classic JSX syntax for CK templates.
import Template from '@ckeditor/ckeditor5-ui/src/template';
const CKTemplateFromJSX = ({elementName, attributes, children}) => new Template({
tag: elementName,
attributes: Object.keys(attributes).filter( key => {
return key.indexOf('on') !== 0
@long-lazuli
long-lazuli / URLParser.js
Last active June 25, 2019 13:18
URL utilities using HTML Anchor Element functionalities
export default const UrlParser = ( urlStr ) => {
const $anchor = document.createElement('a')
$anchor.href = urlStr || window.location
return {
...Object.keys($anchor.__proto__).reduce(
(acc, prop) => ({ ...acc, [prop]: $anchor[prop] }),
{}