Skip to content

Instantly share code, notes, and snippets.

View simi's full-sized avatar
🇨🇿

Josef Šimánek simi

🇨🇿
View GitHub Profile
class MyEnumerator
include Enumerable
attr_writer :args
attr_writer :size
attr_reader :generator
attr_reader :lookahead
class MyEnumerator
attr_reader :scope, :block, :opened, :headers
def initialize(scope, headers, &block)
@scope = scope
@block = block
@opened = false
@cursor = PostgreSQLCursor::Cursor.new(scope.send(:to_unprepared_sql))
@headers = headers
@headers_provided = false
# INFO: works well with Ruby 3.0.1
# hangs on any Ruby including https://github.com/ruby/ruby/commit/f9196de1dee6f5ab8b6fe115070b92775a3500fe
# since the yielding code in each method is running in different Fiber (due to be wrapped into Enumerator and next is used)
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
<body>
<script src="jtsk.js"></script>
Velbloud je na <span data-jstk-x="1043019.76" data-jstk-y="738380.15" id="adresa"></span>
<script>
text = document.getElementById("adresa");
x = parseFloat(text.dataset.jstkX);
y = parseFloat(text.dataset.jstkY)
prevod = new JTSK_Converter();
Friend Class Convertor
Const EPS As Double = 1e-4 ' relative accuracy
' *
' Conversion from JTSK to WGS-84 (by iteration)
'
' @param x
' @param y
' @return array
'
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index ca8032645..4e0d3971c 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -1188,6 +1188,8 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
# other.
class << self
+ attr_accessor :disable_system_update
+
count required_ruby_version
92222 >= 0
60103
2302 >= 1.9.3
2285 >= 2.0.0
1327 >= 2.3.0
900 >= 2.0
872 ~> 2.0
758 >= 1.9
744 >= 2.1.0
source 'https://rubygems.org'
ruby '2.7.0'
gem 'rack'
gem 'rack-test'
gem 'minitest'
@simi
simi / Gemfile
Last active March 13, 2019 09:39
rails6 upsert example
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "rails", github: 'rails/rails', ref: '1816c4f'
gem "pg"
version: '3'
services:
web:
build: .
command: 'bin/rails s -b 0.0.0.0'
volumes:
- .:/app
ports:
- "3000:3000"
depends_on: