Skip to content

Instantly share code, notes, and snippets.

Michał Kuklis mkuklis

Block or report user

Report or block mkuklis

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
@mkuklis
mkuklis / lambda-image-resizer.js
Created Jul 31, 2018
AWS Lambda for image resizing with sharp
View lambda-image-resizer.js
const sharp = require('sharp');
const aws = require('aws-sdk');
const s3 = new aws.S3();
const Bucket = "BucketName";
const transforms = [
{ name: 'small', size: 85 },
{ name: 'medium', size: 160 },
{ name: 'large', size: 250 },
];
View stripes-sample-platform.sh
#!/bin/bash
echo "1. Pulling stripes-sample-platform"
cd ./stripes-sample-platform
yarn unlink @folio/stripes-connect
yarn unlink @folio/stripes-components
yarn unlink @folio/stripes-core
yarn unlink @folio/users
yarn unlink @folio/items
@mkuklis
mkuklis / pull-stripes.sh
Last active Jul 5, 2017
Pull stripes deps
View pull-stripes.sh
#!/bin/bash
# stripes core
echo "1. Pulling stripes-components"
cd ./stripes-components
git pull --rebase
yarn unlink
yarn install
yarn link
View gist:f2397953e8d7edce87fd
var storage = {
init: function (success, error) {
window.requestFileSystem(PERSISTENT, 100 * 1024 * 1024, success, error);
},
write: function (fileName, content, success, error) {
this.init(function (fs) {
fs.root.getFile(fileName, { create: true }, function (fileEntry) {
fileEntry.createWriter(function (fileWriter) {
fileWriter.onwriteend = callback;
View docker-mongo.conf
description "mongodb container"
author "ququplay"
start on filesystem and started docker
stop on runlevel [!2345]
respawn
script
# Wait for docker to finish starting up first.
FILE=/var/run/docker.sock
while [ ! -e $FILE ] ; do
inotifywait -t 2 -e create $(dirname $FILE)
View keybase.md

Keybase proof

I hereby claim:

  • I am mkuklis on github.
  • I am michal (https://keybase.io/michal) on keybase.
  • I have the public key with fingerprint 4CC4 26DF 45A8 5858 B8ED  A22C A674 443D E215 6841

To claim this, I am signing this object:

@mkuklis
mkuklis / run.js
Last active Jan 4, 2016
simple run
View run.js
function run(genfun) {
var gen = genfun();
function next(err, answer) {
if (err) {
return gen.throw(err);
}
var res = gen.next(answer);
@mkuklis
mkuklis / gist:7587994
Created Nov 21, 2013
KitKat test for WebSocket
View gist:7587994
function hasWebSocket() {
var m = navigator.userAgent.match(/Android ([0-9]+)\.([0-9]+)/i);
if (m) {
var x = parseInt(m[1], 10);
var y = parseInt(m[2], 10);
return window.WebSocket && (x > 4 || (x == 4 && y >= 4));
}
View gist:6164689
# dump heroku db
heroku pgbackups:capture
# restore
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U postgres -d database_name DUMP_PATH
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
You can’t perform that action at this time.