Skip to content

Instantly share code, notes, and snippets.

View saksmt's full-sized avatar

Kirill Saksin saksmt

View GitHub Profile
def safe[F[_] : Concurrent
: Timer
: Memoize
: ContextShift, T](size: Int,
name: String,
factory: => F[T])
// vs
def safe[F[_] : Concurrent
@saksmt
saksmt / fsplit.py
Last active November 15, 2016 21:33 — forked from bancek/cue_to_mp3.py
CUE splitter using ffmpeg (to source format)
#!/usr/bin/env python2
# Shit code.. TODO: rewrite
import sys
import os
import os.path
import subprocess
import itertools
/**
* @param ${TYPE_HINT} $${PARAM_NAME}
#if (${STATIC} != "static")
* @return ${CLASS_NAME} This instance
#end
*/
#set($TYPE_HINT = $TYPE_HINT.replaceAll("(int(eger)?)|(bool(ean)?)|(string)|object|mixed", ""))
#if (${TYPE_HINT} != "")
#set($TYPE_HINT="${TYPE_HINT} ")
#end
@saksmt
saksmt / CodeStyle.md
Last active August 29, 2015 14:26
Java Code Style (B52)

Именование

Общий Стиль

Никакие сокращения не допускаются.

Именование должно быть таким, что код легко понять и без коментариев.

#
# Gentoo Linux
#
CONFIG_GENTOO_LINUX=y
CONFIG_GENTOO_LINUX_UDEV=y
#
# Support for init systems, system and service managers
#
# CONFIG_GENTOO_LINUX_INIT_SCRIPT is not set
@saksmt
saksmt / TableRendererInterface.php
Last active August 29, 2015 14:17
Abstraction on table rendering
<?php
/**
* @example
* $htmlRenderer = new HtmlRenderer();
* $consoleRenderer = new ConsoleRenderer();
* $htmlRenderer->renderToFile($view, 'some.html', [ TableRendererInterface::STREAMED ]);
* echo $consoleRenderer->renderToString($profilingView);
*/
interface TableRendererInterface
@saksmt
saksmt / ObjectOriented.js
Created February 26, 2015 22:39
Extension for JavaScript providing object oriented feature
(function (global) {
'use strict';
/**
* @return {Function} Abstract function placeholder
*/
Function.prototype.makeAbstract = function () {
return function () {
throw new Error('Abstract method can\'t be called.');
};
};
@saksmt
saksmt / README.md
Created December 21, 2014 00:37
Flac(cue) splitting commandline utility

music-splitter

Simple commandline utility providing support for reqursively walk through all music directories and split large .flac files.

Requirements

Any linux distribution with split2flac, php and find.

@saksmt
saksmt / clock.js
Created December 9, 2014 18:36
Clock for Browser(Usefull with 2 monitors)
(function (window) {
'use stict';
/**
* Replaces "{slug}" with specified values, provided by argument
* @brief Set's slugs in string
* @param {Object} slugValues Map "slugName:slugValue"
* @returns {String}
*/
String.prototype.setSlugs = function (slugValues) {
var
@saksmt
saksmt / gist:baebd25deca65a792aee
Created October 1, 2014 09:40
Java: get all implementations of interface
interface Interface {}
class InterfaceImpl1 implements Interface {}
class InterfaceImpl2 implements Interface {}
class Main {
private static List<Class<? extends Interface>> interfaceImplementations;
static {
interfaceImplementations = new ArrayList(Interface.class.getClasses()); // <- Doesn't work :(
}