Skip to content

Instantly share code, notes, and snippets.

View nicholaswmin's full-sized avatar
💭
I may be slow to respond.

Nicholas Kyriakides nicholaswmin

💭
I may be slow to respond.
  • Co-founder/Lead Engineer at Bitpaper
  • London/Nicosia
View GitHub Profile
@nicholaswmin
nicholaswmin / styles.less
Created April 29, 2024 15:43
Super Minimal Atom/Pulsar stylesheet
/*
* File -> Stylesheet and copy this
* - Makes everything darker
* - Mutes distracting labels
*/
.bg() {
background-color: #222;
background: #222;
}
@nicholaswmin
nicholaswmin / sublime-like-atom.json
Created April 29, 2024 15:42
Theme Override to color a Sublime Text 4 tree view in orange/green/red for modified/added/deleted files
// Activate the 'Default Dark' theme and then customise it
// Drop this in the editor
{
"extends": "Default Dark.sublime-theme",
"variables": {
"vcs_untracked": "var(--greenish)",
"vcs_modified": "var(--orangish)",
"vcs_missing": "var(--redish)",
"vcs_staged": "var(--bluish)",
"vcs_added": "var(--greenish)",
@nicholaswmin
nicholaswmin / stylesheet.less
Created April 29, 2024 15:04
Pulsar Super Minimal
/*
* Your Stylesheet
*
* This stylesheet is loaded when Pulsar starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Pulsar.
* If you are unfamiliar with Less, you can read more about it here:
* http://lesscss.org
*/
const storedToken = null
module.exports = () => {
if (storedToken)
return storedToken
return fetch('./login')
.then(token => {
storedToken = token
@nicholaswmin
nicholaswmin / aircraft.js
Last active March 21, 2018 17:50
Parking Simulator Aircraft Movements
{
aircraft: [
// aircraft 1
{
id: 'LK-122', // registration number
item: sampleAircraftSVG, // aircraft SVG
// list of movements
movements: [
// movement 1
{
@nicholaswmin
nicholaswmin / .travis.yml
Created May 22, 2017 15:23
Travis CI config for testing Polymer Elements
language: node_js
sudo: required
before_script:
# @next might not be needed in the future since polymer-cli should have
# been updated
- npm install -g bower polymer-cli@next
# Chrome 58 has a WebComponent bug
- sudo mv /usr/bin/google-chrome /usr/bin/google-chrome-old
- sudo mv /usr/bin/google-chrome-beta /usr/bin/google-chrome
node_js: stable
@nicholaswmin
nicholaswmin / ES6LiteralWithType.js
Last active August 4, 2016 19:21
Type preservation in ES6 String Interpolation/Template Literlars
/*
* Preservation of implicit type in interpolated string (ES2015)
*
* Authors:
* - Nik Kyriakides, @nicholaswmin, nik.kyriakides@gmail.com
*
* MIT Licensed
*/
const aNum = 3;
@nicholaswmin
nicholaswmin / polymerES6.html
Last active April 24, 2016 08:15
Polymer element using ES6
<base href="https://polygit.org/components/">
<script src="webcomponentsjs/webcomponents-lite.min.js"></script>
<link href="polymer/polymer.html" rel="import">
<link href="paper-input/paper-input.html" rel="import">
<dom-module id="x-example">
<template>
<paper-input value="{{name::input}}"></paper-input>
<h4>{{name}}</h4>
@nicholaswmin
nicholaswmin / paperKMeans.js
Last active April 16, 2016 18:10
Clustering Paper.js Elements together using the K-means algorithm.
/**
* Clusters a number of Paper Elements as Paper Groups.
* Clustering is based on distance between elements,
* using K-means clustering.
* - This method DOES NOT preserve z-order of items, so use with caution
*
*
* - Dependent on clusterfck.js.
* See: https://github.com/NathanEpstein/clusters
* and download browser .js file.
@nicholaswmin
nicholaswmin / catmullFitter.js
Created September 7, 2015 12:49
Catmull Rom Fitting Algorithm in Javascript through a series of X/Y Points
/**
* Interpolates a Catmull-Rom Spline through a series of x/y points
* Converts the CR Spline to Cubic Beziers for use with SVG items
*
* If 'alpha' is 0.5 then the 'Centripetal' variant is used
* If 'alpha' is 1 then the 'Chordal' variant is used
*
*
* @param {Array} data - Array of points, each point in object literal holding x/y values
* @return {String} d - SVG string with cubic bezier curves representing the Catmull-Rom Spline