Skip to content

Instantly share code, notes, and snippets.

View maciejkorsan's full-sized avatar
🐼
I'm a panda developer.

Maciek Korsan maciejkorsan

🐼
I'm a panda developer.
View GitHub Profile
<div class="scale__container--js">
<h1 class="scale--js">I'm full width!</h1>
</div>
.scale__container--js {
text-align: center;
}
.scale--js {
display: inline-block;
transform-origin: 50% 0;
}
function scaleHeader() {
var scalable = document.querySelectorAll('.scale--js');
var margin = 10;
for (var i = 0; i < scalable.length; i++) {
var scalableContainer = scalable[i].parentNode;
scalable[i].style.transform = 'scale(1)';
var scalableContainerWidth = scalableContainer.offsetWidth - margin;
var scalableWidth = scalable[i].offsetWidth;
scalable[i].style.transform = 'scale(' + scalableContainerWidth / scalableWidth + ')';
scalableContainer.style.height = scalable[i].getBoundingClientRect().height + 'px';
senderPlaceholder.setAttribute('text', `value:from: ${wish.sender}; font: /assets/fonts/raleway/raleway.fnt; fontImage: /assets/fonts/raleway/raleway.png; color: #000000`);
const s = new SyncanoClient('instance-name');
s.get('Christmas2017/get-wishes/', {wish: wishId})
@maciejkorsan
maciejkorsan / config.yml
Last active February 8, 2019 21:58
CircleCI GitHub - FTP deploy config
version: 2
jobs:
build:
docker:
- image: circleci/node:latest
steps:
- checkout
- run: npm install
- run: npx gulp build
- run: node .circleci/deploy.js
@maciejkorsan
maciejkorsan / deploy.js
Created January 24, 2018 13:21
deploy.js script for CircleCI GitHub - FTP upload
var FtpDeploy = require('ftp-deploy');
var ftpDeploy = new FtpDeploy();
var config = {
username: process.env.FTPUSERNAME,
password: process.env.FTPPASS,
host: process.env.FTPHOST,
port: 21,
localRoot: __dirname + "/../dist/",
remoteRoot: "/",
const gpio = require('onoff').Gpio
const hyperdrive = new gpio(3,'out')
hyperdrive.writeSync(1)
const { spawn } = require('child_process');
const player = spawn('aplay', [`audio/chewbacca.wav`]);
import Syncano from '@syncano/core'
export default (ctx) => {
const {channel, response} = new Syncano(ctx)
const {args} = ctx
try {
channel.publish(`global-messages`, {'light': args.light, 'status': args.status})
.then(res => {response(JSON.stringify(res), 200, 'application/json')})
} catch(e) {