Skip to content

Instantly share code, notes, and snippets.

View ducin's full-sized avatar
🛠️
creatin' some stuff

Tomasz Ducin ducin

🛠️
creatin' some stuff
View GitHub Profile
@ducin
ducin / subtitles.py
Created December 6, 2013 10:44
Simple subtitles modifier (handles MicroDVD format), tested on python 2.x
import argparse
parser = argparse.ArgumentParser(description='Move subtitles in MicroDVD format.')
parser.add_argument('input_file', metavar='input_file', type=str, help='input file')
parser.add_argument('output_file', metavar='output_file', type=str, help='output file')
parser.add_argument('frames_diff', metavar='frames_diff', type=float, help='frames difference (check MicroDVD format)')
parser.add_argument('--ignore-lines', dest='ignore_lines', type=int, default=0, help='number of lines to be ignored')
args = parser.parse_args()
import re
@ducin
ducin / version.cpp
Last active December 31, 2015 06:19
boost version check
#include <boost/version.hpp>
#include <iostream>
#include <iomanip>
int main()
{
std::cout << "Using Boost "
<< BOOST_VERSION / 100000 << "." // major version
<< BOOST_VERSION / 100 % 1000 << "." // minor version
<< BOOST_VERSION % 100 // patch level
@ducin
ducin / .gitignore
Last active January 23, 2016 18:47
Grunt JSON-Schema-faker basic demo
node_modules/
output/
@ducin
ducin / index.js
Created April 21, 2016 17:50
use `david` to check available dependency updates
var pkgPath = '<path to package.json file>';
var david = require('david'),
chalk = require('chalk'),
fs = require('fs');
var manifest = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
david.getDependencies(manifest, function (er, deps) {
console.log('\n', chalk.cyan('latest dependencies information for', manifest.name));
@ducin
ducin / reveal.js
Created September 19, 2016 14:27
REVEAL.JS bonus
Reveal.configure({
keyboard: {
40: 'next',
38: 'prev'
}
});
@ducin
ducin / .gitignore
Last active December 5, 2016 17:08
node_modules
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("csp", [], factory);
else if(typeof exports === 'object')
exports["csp"] = factory();
else
root["csp"] = factory();
})(this, function() {
@ducin
ducin / readme.md
Last active April 21, 2017 17:54
resolvedSame - new promise aggregate

resolveSame - new promise aggregate

  • if all promises get rejected - aggregate gets rejected (with positional reasons)
  • if some promises get resolved, then:
    • if they all get resolved with the same value - aggregate gets resolved with theValue
    • otherwise (different resolved values) - aggregate gets rejected with first two different values
@ducin
ducin / sshfs.sh
Created January 22, 2014 07:33
simple script opening/closing sshfs connection with ./sshfs.sh -o or ./sshfs.sh -c
#!/bin/bash
if [ "$1" != "" ]; then
case $1 in
-o | --open ) echo "$USER opening sshfs connection"
open your connection here
;;
-c | --close ) echo "$USER closing sshfs connection"
close your connection here
;;
@ducin
ducin / README.md
Last active April 15, 2018 15:33
JSON-Schema-faker console basic demo

JSON-Schema-faker demo

Run the following:

npm install
node run.js

to execute the demo.