Skip to content

Instantly share code, notes, and snippets.

🐼
I'm a panda developer.

Maciej Korsan maciejkorsan

🐼
I'm a panda developer.
Block or report user

Report or block maciejkorsan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View full-width-header.html
<div class="scale__container--js">
<h1 class="scale--js">I'm full width!</h1>
</div>
View full-width-header.css
.scale__container--js {
text-align: center;
}
.scale--js {
display: inline-block;
transform-origin: 50% 0;
}
View full-width-header.js
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';
View aframe-customfont.js
senderPlaceholder.setAttribute('text', `value:from: ${wish.sender}; font: /assets/fonts/raleway/raleway.fnt; fontImage: /assets/fonts/raleway/raleway.png; color: #000000`);
View syncano-client-connect.js
const s = new SyncanoClient('instance-name');
s.get('Christmas2017/get-wishes/', {wish: wishId})
@maciejkorsan
maciejkorsan / config.yml
Last active Feb 8, 2019
CircleCI GitHub - FTP deploy config
View config.yml
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 Jan 24, 2018
deploy.js script for CircleCI GitHub - FTP upload
View deploy.js
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: "/",
View hyperdrive.js
const gpio = require('onoff').Gpio
const hyperdrive = new gpio(3,'out')
hyperdrive.writeSync(1)
View wookie.js
const { spawn } = require('child_process');
const player = spawn('aplay', [`audio/chewbacca.wav`]);
View socket.js
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) {
You can’t perform that action at this time.