Skip to content

Instantly share code, notes, and snippets.

View kamilziajka's full-sized avatar
🍫
😮

Kamil Ziajka kamilziajka

🍫
😮
View GitHub Profile
FROM node:6
ADD server.js /server.js
ADD cert.pem /cert.pem
ADD key.pem /key.pem
CMD ["node", "/server.js"]
EXPOSE 8080
@kamilziajka
kamilziajka / Dockerfile
Created June 24, 2016 10:55
server-http
FROM node:6
ADD server.js /server.js
CMD ["node", "/server.js"]
EXPOSE 8080
@kamilziajka
kamilziajka / bootstrap.sh
Last active June 4, 2016 23:08
project bootstrap
#!/usr/bin/env bash
npm init --y
cat > .editorconfig <<EOF
root = true
[*.{md,js}]
indent_style = space
indent_size = 2
'use strict';
import Koa from 'koa';
import KoaRouter from 'koa-router';
import {SerialPort} from 'serialport';
const path = '/dev/ttyAMA0';
const options = {baudrate: 9600};
const port = new SerialPort(path, options);
require('babel-register')({
presets: ['es2015', 'stage-0'],
only: 'my-cli/@(src|bin)/*.js'
});
@kamilziajka
kamilziajka / start.js
Created April 7, 2016 10:09
cli config + babel
#!/usr/bin/env node
'use strict';
const path = require('path');
const temp = process.cwd();
process.chdir(path.resolve(__dirname, '../'));
require('config');
process.chdir(temp);
require('babel-register')({
@kamilziajka
kamilziajka / gist:25da3a45d36e3f6f840f
Last active March 11, 2016 14:29
bookshelf virtual property alias
const bookshelf = Bookshelf(knex).plugin('virtuals');
const alias = (property) => ({
get: function () {
return this.get(property)
},
set: function (value) {
this.set(property, value)
}
});
@kamilziajka
kamilziajka / Angular2 router angular_1_router.js
Created February 16, 2016 11:07
Angular2 router angular_1_router.js
npm i @angular/router
import '@angular/router/angular1/angular_1_router';
angular.module('application', [
'ngComponentRouter'
]);