Skip to content

Instantly share code, notes, and snippets.

@stoikerty
stoikerty / moebius-strip.html
Last active February 9, 2019 20:24 — forked from topologicallytony/index.html
Mobius Strip
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Mobius Strip</title>
@stoikerty
stoikerty / products-server.js
Last active April 16, 2018 11:37
Products Server
const express = require('express')
const cors = require('cors')
const server = express()
server.use(cors({ origin: true, credentials: true }))
server.use((req, res, next) => {
const productsResponse = {
products: [
{
@stoikerty
stoikerty / with-babel-register.js
Created August 28, 2017 14:23
Modern javascript at all times
const path = require('path');
// Teach Node how to use babel compilation, using closest babelrc config
require('babel-register');
// Run specified file from second argument when first argument `--run` or `-r` is given
const options = process.argv.slice(2);
const runCommandGiven = (options[0] === '--run' || options[0] === '-r');
const fileToRun = runCommandGiven && path.resolve(process.cwd(), options[1]);
@stoikerty
stoikerty / filesHook.js
Created June 27, 2017 12:27
Example of how dev-toolit v5 handles server-rendering of images
// filesHook.js - adapted from dev-toolkit@5.5.4
import filesHook from 'files-require-hook';
const rootForRequire = process.cwd();
// Set up server-side rendering of image files
// ---
// Implement a hook that uses a file-path for node
export default () => {
@stoikerty
stoikerty / cssHook.js
Last active June 27, 2017 09:42
Example of how dev-toolit v5 handles server-rendering of .sass files
// cssHook.js - adapted from dev-toolkit@5.5.4
import path from 'path';
import cssHook from 'css-modules-require-hook';
import sass from 'node-sass';
const rootForProject = './';
const scssIncludePaths = path.resolve(rootForProject, 'src/client');
const cssChunkNaming = '[name]__[local]___[hash:base64:5]';
@stoikerty
stoikerty / app.js
Created November 27, 2016 15:09 — forked from mjackson/app.js
Using webpack with pixi.js
var PIXI = require('pixi.js')
console.log(PIXI)
@stoikerty
stoikerty / Shell.jsx
Last active March 10, 2017 19:39
Setting up the `dynamic-pages`-package with `dev-toolkit` [ https://github.com/stoikerty/dev-toolkit ]
// ----- src/client/views/Shell.jsx -----
// Dynamic components & pages are handled differently. `react-router` doesn't use the `children` object for rendered content.
// Instead it uses the keys specified in each route defined by dynamic-pages in `routes.jsx`, such as `header` and `content`.
import React, { Component, PropTypes } from 'react';
import s from './Shell/_style.scss';
export default class Shell extends Component {
@stoikerty
stoikerty / .mocha.opts
Last active October 9, 2016 13:58
Setting up tests for `dev-toolkit` npm-package. [ https://github.com/stoikerty/dev-toolkit ]
src/**/*.spec.* utilities/**/*.spec.* --reporter spec
--slow 150
--compilers js:babel-core/register,js:./node_modules/dev-toolkit/dist/webpack/config.js,js:./utilities/testHelpers/setupDOM.js,js:./utilities/testHelpers/setupTests.js
@stoikerty
stoikerty / Article - The Start of it all.md
Last active January 15, 2016 16:22
Article - The Start of it all

The Start of it all

How I decided to land here.

Every now and again, I have this urge to put something out into the World.

I think to myself, there must be something I can contribute. Out of all the things I know how to do, what would be the most beneficial way for me to share it, what should I build, what do people want, what do they need? It all got a bit stressful as I contemplated what my purpose is on the world wide network, where I belong in the world and what my duty is in life. Everything revolved around a thought I had for a while "I want to change the world!".

But how? And why? And what happens thereafter? It was not long before I encountered a quote that reminded me of the philosophical origins of my artist’s name:

@stoikerty
stoikerty / _Article - Lorem Ipsum.md
Last active January 5, 2016 14:05
Article - lorem_ipsum markdown test

Pater nota 3

Flumina tu Liber de victos tenues Albula

Lorem markdownum magni quid, ancipitesque, cuspide paene quae. Dedero dabit periturus albam curvamine et ipsa. Et est quam canis insequitur silvas, terrae adhuc telum sortita effugere Iapygis ibat fonte procul habet.

Esset ulterius procedit non fuit frustra peremptis hic: dixit vota, ibi est. Hoc