Skip to content

Instantly share code, notes, and snippets.

View DeMoorJasper's full-sized avatar
🛠️

Jasper De Moor DeMoorJasper

🛠️
View GitHub Profile
@DeMoorJasper
DeMoorJasper / gist:e1a072b0bd43517d715a4c3751fdc441
Created February 21, 2017 12:01
Balsamiq Mockups keys for mac
2.2.x
Name : Sam
Serial : eJzzzU/OLi0odswsqglOzK0xsjQzNzI2NjA1q3GuMQQAnJAJjw==
3.3.x
Username: personal
eJzzzU/OLi0odswsqilILSrOz0vMqbFEAjXONYY1fu6ufgA/CA4X
@DeMoorJasper
DeMoorJasper / master.js
Created January 6, 2018 12:21
child_process ipc & shared memory experiment
const { fork } = require('child_process');
const cache = require('node-shared-cache');
let childCache = new cache.Cache('children', 524288);
let child;
function startWorker(ready) {
child = fork(require.resolve('./worker'), {
cwd: process.cwd(),
silent: true
});
@DeMoorJasper
DeMoorJasper / TerminalTyper.js
Last active January 23, 2018 15:39
TerminalTyper
const BLOCK_CHAR = '█';
let blockChar = `${BLOCK_CHAR}`;
function updateTerminal(content) {
document.getElementById('terminal').innerHTML = content;
}
function flickerBlock() {
if (blockChar.length > 0) {
blockChar = "";
@DeMoorJasper
DeMoorJasper / entrypoint
Created May 3, 2018 09:33
parcel-plugin-svelte
module.exports = function (bundler) {
bundler.addAssetType('svelte', require.resolve('./SvelteAsset'));
};
const { Asset } = require('parcel-bundler');
class SvelteAsset extends Asset {
constructor(name, pkg, options) {
super(name, pkg, options);
this.type = 'js';
}
async parse(inputCode) {
return {};
@DeMoorJasper
DeMoorJasper / parse.js
Last active May 3, 2018 09:50
Parsing svelte
const { compile, preprocess } = require('svelte');
async parse(inputCode) {
let svelteOptions = {
compilerOptions: {
generate: 'dom',
format: 'cjs',
store: true,
filename: this.relativeName,
css: false
const { compile, preprocess } = require('svelte');
const { Asset } = require('parcel-bundler');
class SvelteAsset extends Asset {
constructor(name, pkg, options) {
super(name, pkg, options);
this.type = 'js';
}
async generate() {
const assertBundleTree = require('parcel-assert-bundle-tree');
const path = require('path');
const SveltePlugin = require('../src/index');
describe('basic', function() {
it('Should create a basic svelte bundle', async function() {
// Init bundler
const bundler = new Bundler(input, Object.assign({
outDir: path.join(__dirname, 'dist'),
watch: false,
@DeMoorJasper
DeMoorJasper / stylish.js
Created May 5, 2018 11:48
Stylish demo
import { stylish } from 'tiny-stylish-components';
const Button = stylish.button`
background: #ffffff;
color: #a2a2a2;
border: none;
`;
render() {
return <Button>I am a button! Click Me!</Button>;
@DeMoorJasper
DeMoorJasper / css event
Created May 5, 2018 12:20
stylish event
import { stylish } from 'tiny-stylish-components';
const Button = stylish.button`
background: #ffffff;
color: #a2a2a2;
border: 1px solid #a2a2a2;
border-radius: 5px;
width: 100px;
padding: 5px 10px;
&:hover {