Skip to content

Instantly share code, notes, and snippets.

Latchezar Tzvetkoff tzvetkoff

Block or report user

Report or block tzvetkoff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tzvetkoff
tzvetkoff / README.md
Last active Apr 11, 2018
JetBrains Toolbox CLI Scripts
View README.md

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'
View keybase.md

Keybase proof

I hereby claim:

  • I am tzvetkoff on github.
  • I am tzvetkoff (https://keybase.io/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
tzvetkoff / zwch.py
Last active Jan 2, 2018
Sublime Text plugin that tries to detect and mark zero-width characters
View zwch.py
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.
http://en.cppreference.com/w/cpp/language/identifiers
"""
@tzvetkoff
tzvetkoff / .termcap
Created Mar 21, 2016
FreeBSD $HOME/.termcap
View .termcap
xterm-256color|xterm with 256 colors and clear:\
:Co#256:pa#32767:\
:AB=\E[48;5;%dm:AF=\E[38;5;%dm:\
:tc=xterm-new:tc=xterm-clear:
@tzvetkoff
tzvetkoff / httpd.js
Last active Mar 21, 2016
Simple NodeJS HTTPd
View httpd.js
#!/usr/bin/env node
var
http = require('http'),
url = require('url'),
path = require('path'),
fs = require('fs');
var WebServer = function(port) {
var _this = this;
@tzvetkoff
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 'https://rubygems.org'
gem 'rails', :github => 'rails/rails'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
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
begin
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}
end
end
You can’t perform that action at this time.