Skip to content

Instantly share code, notes, and snippets.

@Dmitra
Dmitra / README.md
Last active November 17, 2019 16:39
Mapping ellipses in geo projection

First commit

class DataController
def normalize
@result = ""
file = File.open("params", "w")
file << params[:data]
file.close
`iconv -c -f UTF-8 -t WINDOWS-1251 params > in`
`./mystem -l in out`
`iconv -c -f WINDOWS-1251 -t UTF-8 out > result`
file = File.open("result", "r")
@Dmitra
Dmitra / gist:6d40f7655daeaad04d354e745166c0c2
Created October 31, 2018 12:51
Get dot-separated deep keys of the object
import _ from 'lodash'
const o = {
a: 1,
b: {
c: 2
}
}
const getKeysDeep = o => (
@Dmitra
Dmitra / txt2graphml.rb
Last active August 12, 2016 06:33
convert indented text to graphml
class File
def to_string
string = ''
self.each {|line|
string << line
}
return string
end
end
@Dmitra
Dmitra / parse.js
Created May 27, 2015 09:38
bunch file processor
#!/usr/bin/env node
var fs = require('fs')
, wrench = require('wrench')
//works under linux
//, parser = require('xml2json')
, path = process.cwd()
_ = require('lodash')
var test = function(files){
@Dmitra
Dmitra / big_image_processor.js
Last active August 12, 2016 06:32
process very big images by splitting to squares
#!/usr/bin/env node
var inputFolder = './';
var ext = '.png';
var fs = require('fs')
, gm = require('gm')
, spawn = require('child_process').spawn;
//gm(inputFolder + '0-0.png')
@Dmitra
Dmitra / README.md
Last active August 12, 2016 06:39 — forked from mbostock/.block
encapsulate D3 module functionality in one object

This fork of axis example use changed D3's axis component. The goal of rewrite is to incapsulate all module functionality in one object.