Skip to content

Instantly share code, notes, and snippets.

Avatar

sevastos sevastos

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am sevastos on github.
  • I am sev (https://keybase.io/sev) on keybase.
  • I have a public key ASBYNrE63SDNoPvMlC4zQxdkJwCzYaqpwc9z2Lr-EgwlUgo

To claim this, I am signing this object:

@sevastos
sevastos / index.js
Last active May 17, 2017
requirebin sketch
View index.js
class Trend {
constructor(database) {
this.database = database;
}
create() {
console.log('create', this.database);
this.database.query();
}
}
@sevastos
sevastos / tourney.html
Last active Jun 24, 2022 — forked from sterlingwes/tourney.html
Tournament Bracket Generator (Javascript + CSS, no tables)
View tourney.html
<!DOCTYPE html>
<html>
<head>
<title>Tournament Bracket Generator</title>
<script src="https://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="https://cdn.jsdelivr.net/clipboard.js/1.6.0/clipboard.min.js"></script>
<script>
$(document).on('ready', function() {
View stroj-tracker.js
// INSTRUCTIONS:
// 1. Update settings & addresses (line 14)
// 2. Generate a bookmarklet using http://chriszarate.github.io/bookmarkleter/
// 3. use it while on http://driveshare.org/status.html
// MAIN CODE:
// Settings
//
// Address to watch.
View designer.html
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-progress/paper-progress.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@sevastos
sevastos / docker-mongo-virtualbox.md
Last active Dec 3, 2022
Boot2Docker (VirtualBox) MongoDB volume filesystem issue
View docker-mongo-virtualbox.md

Journey

I was using Boot2Docker 1.2 (OSX) and wanted to use volume for MongoDB. First nothing was happening because 1.2 has no Guest Additions and volumes don't work. There is a workaround by making a boot2docker.iso from master which has Guest Additions.

But then Mongo didn't like putting data on VirtualBox's shared folders:

[initandlisten] 	WARNING: This file system is not supported. For further information see:
[initandlisten] http://dochub.mongodb.org/core/unsupported-filesystems
@sevastos
sevastos / classList-multipleClasses.js
Last active Dec 20, 2015
Wrapper for adding/removing multiple classes with classList API. Browsers do not identify multiple class names the same way (space delimited or arguments-based)
View classList-multipleClasses.js
// Usage:
// el.classList.addMany('so', 'simple');
// el.classList.removeMany('inconsistencies', 'please')
['add', 'remove'].forEach(function(action) {
DOMTokenList.prototype[action + 'Many'] = function() {
for (var i = arguments.length - 1; i >= 0; i--) {
this[action](arguments[i]);
};
}
@sevastos
sevastos / aws-multipartUpload.js
Last active Dec 2, 2022
Example AWS S3 Multipart Upload with aws-sdk for Node.js - Retries to upload failing parts
View aws-multipartUpload.js
// Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload
var fs = require('fs');
var AWS = require('aws-sdk');
AWS.config.loadFromPath('./aws-config.json');
var s3 = new AWS.S3();
// File
var fileName = '5.pdf';
var filePath = './' + fileName;
var fileKey = fileName;
View index.html
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>x</title>
<meta name="description" content="">
@sevastos
sevastos / QRit.js
Created Jan 26, 2013
QRit - QR generation code of the current page
View QRit.js
javascript:(function(){if(document.getElementById('qrit'))document.removeChild(document.getElementById('qrit'));qrimg=document.createElement('img');qrimg.setAttribute('style','position:fixed;top:0;left:0;z-index:9999;padding:5px;background-color:#fff');qrimg.setAttribute('id','qrit');qrimg.setAttribute('src','http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl='+encodeURI(document.location.href));document.body.appendChild(qrimg);})();