This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fj3390ty-a.yaml | |
name: Метеостанция FJ3390TY-A | |
products: | |
- id: cvurn5ynloebrpwy # Product ID из scan | |
entities: | |
- entity: sensor | |
name: Температура в помещении | |
class: temperature | |
dps: | |
- id: 101 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fj3395ty.yaml | |
name: Метеостанция FJ3395TY | |
products: | |
- id: 6cwineqz1ndjmuee # Product ID из tinytuya | |
entities: | |
- entity: sensor | |
name: Температура в помещении | |
class: temperature | |
dps: | |
- id: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
def apply latitude, longitude, files | |
len = files.length | |
files.each_with_index do |file, idx| | |
system("exiftool -GPSLatitude=#{latitude} -GPSLongitude=#{longitude} -Latitude=#{latitude} -Longitude=#{longitude} -XMP:GPSLatitude=#{latitude} -XMP:GPSLongitude=#{longitude} #{file}") | |
puts "#{idx} of #{len}: #{file}" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FindProxyForURL(url, host) { | |
if (dnsDomainIs(host, ".i2p")) { | |
return "PROXY 127.0.0.1:4444"; | |
} else { | |
return "DIRECT"; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require 'pp' | |
require 'rack' | |
app = proc do |env| | |
[ | |
200, | |
{ 'Content-Type' => 'text/plain' }, | |
[ env.pretty_inspect ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
def log msg, file, line | |
$stderr.puts "[#{file}:#{line}] #{msg}" | |
end | |
log 'Сообщение', __FILE__, __LINE__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require './prop00' | |
class Alpha | |
property :alpha, :beta | |
attr_accessor :gamma | |
end | |
a = Alpha.new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
puts 'begin' | |
th = Thread.new do | |
(1..3).each { |i| puts i } | |
end | |
# sleep 0 | |
puts '---' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
class Alpha | |
attr_accessor :alpha | |
def beta | |
self.alpha = 1 | |
alpha = 2 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require 'drb' | |
# DRb.start_service | |
a = DRbObject.new nil, 'druby://localhost:9000' | |
p a.alpha(1) | |
p a.alpha(nil) | |
p a.alpha("beta") |
NewerOlder