Skip to content

Instantly share code, notes, and snippets.

🎄

Eduard Bondarenko edbond

🎄
  • Kyiv, Ukraine
View GitHub Profile
View main.dart
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
View transition_drawer.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class TransitionDrawer extends StatefulWidget {
final Widget child;
final StreamController<void> toggleStream;
TransitionDrawer({
@edbond
edbond / active_job_retry_controlable.rb
Last active Feb 5, 2020 — forked from necojackarc/active_job_retry_controlable.rb
To enable ActiveJob to control retry
View active_job_retry_controlable.rb
module ActiveJobRetryControlable
extend ActiveSupport::Concern
DEFAULT_RETRY_LIMIT = 5
class_methods do
def retry_limit(retry_limit)
@retry_limit = retry_limit
end
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>UI</title>
<style type="text/css">
#loader {
min-height: 100vh;
display: flex;
View city_autocomplete.dart
import 'package:puppeteer/puppeteer.dart';
import "package:test/test.dart";
cityAutocomplete(Browser browser) {
test("City Autocomplete include New York", () async {
// Open a new tab
var page = await browser.newPage();
// Go to a page and wait to be fully loaded
await page.goto(...);
@edbond
edbond / arrvsset.rb
Created Mar 29, 2018
Array include vs Set include
View arrvsset.rb
# frozen_string_literal: true
require 'set'
require 'benchmark/ips'
ARRAY = 100_000.times.map(&:itself)
SET = Set.new(ARRAY)
def array_include?
ARRAY.include?(50_000)
View rails41_jsonb.rb
Rails.application.config.after_initialize do
ActiveSupport.on_load(:active_record) do
oid = ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID
# https://github.com/rails/rails/blob/v4.2.3/activerecord/lib/active_record/connection_adapters/postgresql/oid/jsonb.rb
oid::Jsonb = Class.new(oid::Json) do
def type
:jsonb
end
View spyke.rb
class JSONParser < Faraday::Response::Middleware
def parse(body)
json = MultiJson.load(body, symbolize_keys: true)
{
data: json[:result],
metadata: json[:extra],
errors: json[:errors]
}
@edbond
edbond / doc.md
Last active Sep 9, 2018
external JS with react-native, clojurescript and re-natal
View doc.md
View transit vs json vs edn
Ξ transit/transit-cljs → node target/transit.bench.js
100 iters, JSON.parse seattle data
"Elapsed time: 81.000000 msecs"
100 iters, transit read seattle data
"Elapsed time: 105.000000 msecs"
100 iters, JSON.stringify seattle data
"Elapsed time: 44.000000 msecs"
100 iters, transit write seattle data
"Elapsed time: 1204.000000 msecs"
100 iters, transit write seattle data no-cache
You can’t perform that action at this time.