Skip to content

Instantly share code, notes, and snippets.


Dmitry Mozzherin dimus

  • University of Illinois
  • Champaign, IL, US
View GitHub Profile
dimus / main.go
Last active Dec 1, 2020
TaxonWorks API
View main.go
package main
import (
dimus / cloudSettings
Last active Feb 12, 2021
Visual Studio Code Settings Sync Gist
View cloudSettings
View test_neti_neti_server.rb
#!/usr/bin/env ruby
# encoding: utf-8
require 'rest_client'
HOST = "localhost"
res = RestClient.get("http://#{HOST}:6384")
puts "GET request"
puts res
dimus / .bashrc
Created Sep 25, 2011
Example of .bashrc
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
dimus / .gemrc
Created Sep 24, 2011
Gemrc file
View .gemrc
gem: --no-ri --no-rdoc
:backtrace: false
:benchmark: false
:bulk_threshold: 1000
:update_sources: true
:verbose: true
dimus / .git_colors
Created Sep 24, 2011
command line promt for git
View .git_colors
# Set our bash prompt according to the branch/status of the current git
# repository.
# Forked from
View gist:1239278
name=Your Name
user = your_github
[color "branch"]
dimus / Hash.from_xml using Nokogiri
Created Mar 17, 2010
Adding Hash.from_xml method using Nokogiri
View Hash.from_xml using Nokogiri
# USAGE: Hash.from_xml:(YOUR_XML_STRING)
require 'nokogiri'
# modified from
class Hash
class << self
def from_xml(xml_io)
result = Nokogiri::XML(xml_io)
return { => xml_node_to_hash(result.root)}
dimus / damerau_levenshtein distance for ruby
Created Jul 14, 2009
Damerau-Levenshtein distance for ruby in C
View damerau_levenshtein distance for ruby
#!/usr/bin/env ruby1.9
# encoding: UTF-8
require 'rubygems'
require 'inline'
require 'time'
class DamerauLevenshtein
def distance(str1, str2, block_size=2, max_distance=10)
res = distance_utf(str1.unpack("U*"), str2.unpack("U*"), block_size, max_distance)
(res > max_distance) ? nil : res