Skip to content

Instantly share code, notes, and snippets.

View oleq's full-sized avatar
☀️

Aleksander Nowodzinski oleq

☀️
View GitHub Profile
@oleq
oleq / example.html
Last active February 12, 2019 13:24
CKEditor 5 IframeView usage example
<div id="editor">
<p>A paragraph.</p>
</div>
<style>
.ck .ck-balloon-panel iframe {
width: 400px;
height: 250px;
}
</style>
@oleq
oleq / cke5-postcss-theme-loader.js
Created October 16, 2017 09:30
A PostCSS theme loader for CKEditor 5
const fs = require( 'fs' );
const path = require( 'path' );
const postcss = require( 'postcss' );
const postcssImport = require( 'postcss-import' );
const postcssCssnext = require( 'postcss-cssnext' );
module.exports = postcss.plugin( 'postcss-ck-theme-importer', ( options ) => {
const themeName = options.themePath.split( '/' ).slice( -1 );
console.log( `Using theme "${ themeName }".` );
@oleq
oleq / logui.js
Last active January 19, 2017 10:06
UI logger for CKEditor5
window.logUi = ( view ) => {
console.group( `%c ${ view.constructor.name}`, 'color: green' );
console.log( 'element', view.element );
for ( let col of view._viewCollections ) {
const isUnbound = col === view._unboundChildren;
const isEmpty = !col.length;
console[ isEmpty ? 'groupCollapsed' : 'group' ]( `%c ViewCollection (${ col.length }) ${ isUnbound ? '(unbound)' : '' }`, `color: ${ isEmpty? 'rgba(0,0,0,.3)' : 'black' }` );
@oleq
oleq / _README.md
Last active January 7, 2024 10:38
A2DP audio streaming using Raspberry PI (Raspbian Jessie)

What is this all about?

This tutorial will turn your Raspberry PI into a simple Bluetooth audio receiver, which plays music through connected speakers. It's like a regular car audio system, but it can be used anywhere and it's a good value.

   Audio source (i.e. smartphone) 
                |
                v
 (((  Wireless Bluetooth Channel  )))
 |
@oleq
oleq / ie8rocks.js
Created June 16, 2014 10:10
This is how IE8 plays with <object> (document#querySelector, element#childNodes)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>IE8 rocks!</title>
</head>
<body>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
<param name="allowFullScreen" value="false" />
<param name="quality" value="high" />
var getWeek = function(d) {var e=new Date(d),f=e.setDate(d.getDate()-(d.getDay()+6)%7+3);e.setMonth(0,4);return((f-e)/6048e5)+1.5|0};
var testData = {
'2005-01-01': 53,
'2005-01-02': 53,
'2005-12-31': 52,
'2007-01-01': 01,
'2007-12-30': 52,
'2007-12-31': 01,
'2008-01-01': 01,