Skip to content

Instantly share code, notes, and snippets.

View dmitry's full-sized avatar
🇪🇪
Water, earth and air.

Dmitry Polushkin dmitry

🇪🇪
Water, earth and air.
View GitHub Profile
@dmitry
dmitry / gist:f8c5c2b7c8bfafbcc4ded36c3f1f562e
Created November 29, 2019 05:56
Saved Places.json to GPX
https://takeout.google.com/
http://nearby.org.uk/convert-saved-places.php
https://kml2gpx.com/?results
@dmitry
dmitry / gist:da7d835307d77ecc6d9c597c6fbf09e4
Created July 29, 2019 10:24
Kinnisvara недвижимость эстония продажа
https://www.facebook.com/groups/375161055994516
kuldnebors.ee
okidoki
kv.ee
city24.ee
soov
Kinnisvara24
osta.ee
WWOOF - http://www.wwoof.org/
Help Exchange http://www.helpx.net/
Global Ecovillage Network ecovillage.org/
Dm__________Gm
Нежность....Нега...
_________C
Я в тебя плыву,лечу....
F___________________B
Я лучом,дождем и снегом
В твою душу постучу.
Gm
Прошепчу тебе признанье
https://fasttext.cc/docs/en/supervised-tutorial.html
https://www.samtalksml.net/aligning-vector-representations/
https://medium.com/@makcedward/from-my-experience-i-just-try-a-magic-number-d4dcc6179ea3
https://habr.com/ru/post/436878/
require 'open-uri'
urls = %w(3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 54 60 66 72 84 96 108 120 132 144 156 168 180).map do |i|
"https://www.passageweather.com/maps/baltic/rain/%03d.png" % i
end
`wget #{urls.join(' ')}`
`convert -loop 0 -delay 50 *.png rain.gif`
`rm *.png`
@dmitry
dmitry / gist:2117358fc5018d407aee2b0a78486c34
Last active May 17, 2018 08:52
pulseaudio skype alsa
https://answers.microsoft.com/en-us/skype/forum/skype_linux-skype_callms-skype_audioms/skype-for-linux-beta-sound-problem/6ea7f878-5c6c-42b3-bc86-cef605f13397
https://wiki.archlinux.org/index.php/PulseAudio
http://www.pc-freak.net/blog/how-to-fix-pulseaudio-and-skype-crappy-sound-glitches-choppy-sound-and-crackling-on-debian-gnu-linux/
https://askubuntu.com/questions/279407/how-to-disable-microphone-from-auto-adjusting-its-input-volume
@dmitry
dmitry / paperclip_cleanup_undeleted_files.rb
Last active February 8, 2018 23:07
Cleanup undeleted paperclip files from the filesystem
a = Dir[Rails.root.join('public/system/photos/original/*').to_s]; 1
not_exists = a.map {|v| v.match(/\/([^\/]+)\.[^\/]*\z/).to_a[1].to_i } - Photo.pluck(:id)
not_exists.count
files = Dir[Rails.root.join('public/system/photos/**/*').to_s]; 1
match = Regexp.new("\/(#{not_exists.join('|')})\\.[^\/]*\\z")
matched = files.select {|v| v =~ match }; 1
@dmitry
dmitry / convert_utf8_to_utf8mb4
Last active January 22, 2018 08:06 — forked from dschneider/convert_utf8_to_utf8mb4
How to easily convert utf8 tables to utf8mb4 in MySQL 5.5
# For each database:
ALTER DATABASE century21_development CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
# For each table:
SELECT CONCAT('ALTER TABLE `', TABLE_NAME,'` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;') AS mySQL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA= "century21_development"
# For each column:
select CONCAT('ALTER TABLE `', TABLE_SCHEMA, '.', TABLE_NAME,'` CHANGE ',COLUMN_NAME,' ', COLUMN_NAME, ' ', DATA_TYPE,'(',CHARACTER_MAXIMUM_LENGTH,') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;') as column_alter from INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE IN('varchar', 'text') AND TABLE_SCHEMA = 'century21_development'
@dmitry
dmitry / slavmir.fm.rb
Created January 17, 2018 22:12
Download audio files
require 'open-uri'
require 'nokogiri'
domain = 'https://slavmir.fm'
Nokogiri::HTML(open(domain + '/blogs/programmy')).css('.article_preview').to_a.each do |v|
url = domain + v.attributes['href'].value
Nokogiri::HTML(open(url)).css('.track-play').to_a.each do |z|
`curl "#{z.attributes['data-play-music'].value}" -O`