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
@long-lazuli
long-lazuli / dabblet.css
Created June 19, 2013 10:52
Test with data:image/png;base64 embedded image
/**
* Test with data:image/png;base64 embedded image
*/
background: #CCC;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAgAElEQVR4nHxdeUBN2/f/vOM4juPYbtd13a4k4zM+8zwWIiVKUigikQYkmkUDMhTJWFQqpZkSZS6RMbMkPNMzPcP7GvN4fn/c9nFv8Vt/3TPtYe21117zxenTp1lowfnz56XrsLAwxtLS0ujTp088ACxbtqxNSEgICwA7duyQaX/Xtm3bNubm5nx4eDjftm1bcvDgQQIALi4uLACMHDmSAYBTp04JdnZ2LAAMHTqUAMDBgwdJaWkpIwiC6OzszKAWnDlzRg4AJiYmytDQUD44OJgtKCjga78HALdu3eLob0dHR2VOTo5c+3loaGhH7Ws/Pz+R/n7//r2wePFiftKkScoHDx5IeBg+fLj0zsWLF1kAyMjI4AHAwcFBnD59OgMABQUFqsePH7MAcO7cOR28AkBxcbFi2bJl4rBhwyg++aysLGkePXr0IPjzzz9ZAKhfvz5JSkoia9euJRs3bmQVCgUPAHZ2djoTysjIUPr5+UmN7NmzhwBAWload/fuXWbdunX82bNnCQBMmzZNBgAbNmxQAcDMmTPFvLw8gX7bqlUr7uLFi/z69euJp6cnSU5OFoKCgpSurq7KoKAgdurUqQwArF27VqFQKFgA6N27Nzd37lxx+/bt8vfv37OWlpbcrFmzFMeOHZMW8uTJkyQkJITULBABgI0bN8oAYMaMGQr63tatW5X0d3Z2drszZ85IYwOA0aNHkz179rAA0L59e6Wfnx+n/fzhw4divXr1hN27dwsA0LVrV0KfBQcHM3fu3BEBQK1WE3Nzc6ntjIwMLjc3l+nUqROjVCqFffv28QDw/PnzH0Q2YsQIiQoAYOzYsaKLiws/bdo0Li0tjVRVVck
// @jsxFactory: $create
// untested yet
const D=document,Arr=(a,b,e) => Array.prototype.slice.call(a,b,e)
export $ = (s,r=D) => r.querySelector(s)
export $$ = (s,r=D) => Arr(r.querySelectorAll(s))
export $create = (t,p={},c,el) => (
el=D.createElement(t),
Object.keys(p).forEach(k=>el.setAttribute(k,p[k])),
@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] }),
{}
import { MultilineError } from './errors'
function getPathParts( path ){
const DIVIDER = /(\]?[.[])/
return path
.split( DIVIDER )
// .map( String.trim.bind )
}
@long-lazuli
long-lazuli / newSyntaxe.md
Last active July 13, 2018 09:17
My daily-rad.io fluxText #dailyradio
@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
Atom Editor Configuration
@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 / 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;
}
}