Skip to content

Instantly share code, notes, and snippets.

View alxgsv's full-sized avatar
🔽

Alex Gusev alxgsv

🔽
View GitHub Profile
### Keybase proof
I hereby claim:
* I am alxgsv on github.
* I am alxgsv (https://keybase.io/alxgsv) on keybase.
* I have a public key ASB1vhP5bShQR8cC3pbIrxcoqgiHnhSNKYeq4aYG2SNotgo
To claim this, I am signing this object:
@alxgsv
alxgsv / search_emoji.py
Last active May 15, 2023 07:43
Get subset of .ttf emoji font and convert to .woff for web usage
import os
import re
import sys
from collections import Counter
import emoji
def is_emoji(s):
return s in UNICODE_EMOJI
def extract_emojis(s):
@alxgsv
alxgsv / shell.log
Last active May 10, 2023 10:44
Ruby array += vs <<
$ ruby test.rb
40.268058
0.046918
@alxgsv
alxgsv / keybase.md
Created February 5, 2016 06:35
keybase.md

Keybase proof

I hereby claim:

  • I am longman on github.
  • I am alxgsv (https://keybase.io/alxgsv) on keybase.
  • I have a public key ASCD7HxHBziLmGPwsH2Cvyp8y6EK8lWL3Lw12qWOcJOm8go

To claim this, I am signing this object:

@alxgsv
alxgsv / gist:6220357
Created August 13, 2013 11:50
Convert bytes list to utf-8 string
function bytes2string(bytes) {
var ix = 0;
if( bytes.slice(0,3) == [239, 187, 191]) {
ix = 3;
}
var string = "";
for( ; ix < bytes.length; ix++ ) {
var byte1 = bytes[ix];
@alxgsv
alxgsv / fr_cleaning.rb
Created December 8, 2012 16:03
FineReader HTML post processing
#!/usr/bin/env ruby
# encoding: utf-8
require "rubygems"
require "nokogiri"
require "typograf"
content = File.open(ARGV[0]).read.force_encoding("cp1251").encode('UTF-8')
doc = Nokogiri::HTML(content)
@alxgsv
alxgsv / onchange.sh
Created August 19, 2011 10:22 — forked from senko/onchange.sh
Watch current directory and execute a command if anything in it changes
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of