Skip to content

Instantly share code, notes, and snippets.

@trsdln
trsdln / csv2libsvm.py
Created February 10, 2016 16:25
Class for converting CSV file to libsvm format
#!/usr/bin/env python
"""
Convert CSV file to libsvm format.
Note: All strings will be converted into numbers (see StringValuesHelper)
based on: https://github.com/zygmuntz/phraug/blob/master/csv2libsvm.py
Usage example:
@trsdln
trsdln / es6-singleton-example.js
Last active March 12, 2016 08:31
Simple singleton using ES6
class SingletonTest {
constructor() {
//intialize you singletone here
}
static getInstance() {
if (!SingletoneTest._instance) {
SingletonTest._instance = new SingletonTest();
}
@trsdln
trsdln / detect-configs.sh
Last active November 23, 2016 13:38
Simple script that allows to find junk files after application removal on Mac OS X
#!/bin/bash
#
# Mac OS X Junk config files detection
#
# Usage:
# ./detect-configs.sh microsoft
#
# - detect Microsoft's config files
#
@trsdln
trsdln / unit_testing_from_sratch.ts
Last active June 4, 2016 09:38
TypeScript Unit testing from sractch
//this is test framework
class TestCase {
protected assertEquals(a,b){
if(a === b){
return true;
}else{
throw new Error(`Equals failed: "${a}" is not equal "${b}"`);
}
}
}
@trsdln
trsdln / notification-sender.js
Created July 14, 2016 08:24
Centralized notification sending
class LazyBlazeTemplateCompiler {
constructor() {
//store compiled templates in key-value store
this._templateCache = {};
}
compile(templateName) {
//check if template already compiled
//compile if it isn't yet compiled
const handleBarsText = Assets.getText(`notification-templates/${templateName}`);

Keybase proof

I hereby claim:

  • I am trsdln on github.
  • I am trsdln (https://keybase.io/trsdln) on keybase.
  • I have a public key ASDgFO6IIUQeSe_UUbGnXAKoe6Ldt9GvBU3JeyHULNHhAwo

To claim this, I am signing this object:

import R from 'ramda';
import HMD from 'hm-def';
import $ from 'sanctuary-def';
import F from 'fluture';
import { env, create as createS } from 'sanctuary';
import { env as flutureEnv } from 'fluture-sanctuary-types';
const funcName = R.concat ('func-sandbox/');
const docsLink = R.concat ('http://trsdln.com/func-sandbox#');