Skip to content

Instantly share code, notes, and snippets.

Latchezar Tzvetkoff tzvetkoff

View GitHub Profile
tzvetkoff /
Last active Apr 11, 2018
JetBrains Toolbox CLI Scripts

JetBrains Toolbox CLI Scripts

JetBrains Toolbox fails to update it's CLI scripts from time to time, and even if it does - they don't work as expected.

This is my ugly attempt to fix this on OSX.

View rescuable.rb
# Rescuable allows you to lazily wrap methods with a rescue logic outside.
# Example:
# class Foo
# extend Rescuable
# def kaboom
# raise RuntimeError, 'This will be rescued and will return 1337'
# raise 'This, however, will not be rescued'

Keybase proof

I hereby claim:

  • I am tzvetkoff on github.
  • I am tzvetkoff ( on keybase.
  • I have a public key whose fingerprint is 2048 FDA4 BCA7 5247 569C 4936 A1AB 5FAA 53E8 6CC3

To claim this, I am signing this object:

tzvetkoff /
Last active Jan 2, 2018
Sublime Text plugin that tries to detect and mark zero-width characters
import sublime
import sublime_plugin
class ShowZeroWidthCharacters(sublime_plugin.EventListener):
Tries to detect and mark zero-width joiners, non-joiners, and other invisible characters.
Most of the characters were detected by manually testing code points from C++ specs.
tzvetkoff / .termcap
Created Mar 21, 2016
FreeBSD $HOME/.termcap
View .termcap
xterm-256color|xterm with 256 colors and clear:\
tzvetkoff / httpd.js
Last active Mar 21, 2016
Simple NodeJS HTTPd
View httpd.js
#!/usr/bin/env node
http = require('http'),
url = require('url'),
path = require('path'),
fs = require('fs');
var WebServer = function(port) {
var _this = this;
tzvetkoff / gist:7287456
Last active Jan 8, 2019
Make it more test-ish
View gist:7287456
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source ''
gem 'rails', :github => 'rails/rails'
gem 'sqlite3'
system 'bundle'
View gist:3371287
#!/usr/bin/env ruby
require 'set'
require 'cgi'
require 'exifr'
require 'rmagick'
require 'fileutils'
module HTML
View gist:3371275
#!/usr/bin/env ruby
require 'fileutils'
require 'exifr'
Dir['Photos/*.*'].each { |filename|
source = "#{Dir.pwd}/#{filename}"
destination = nil
View gist:3182946
def collection_from_string(songs_as_string, artist_tags)
songs_as_string.strip.split("\n").map do |line|
name, artist, genre, tags = line.split('.').map(&:strip)
genre, subgenre = genre.split(',').map(&:strip)
tags = tags.to_s.split(',').push(genre).push(subgenre).concat(Array(artist_tags[artist])).reject(&:nil?).map(&:strip).map(&:downcase)
{:name => name, :artist => artist, :genre => genre, :subgenre => subgenre, :tags => tags}
You can’t perform that action at this time.