Skip to content

Instantly share code, notes, and snippets.

[package]
name = "specs_saveload_derive"
edition = "2018"
[dependencies]
specs = { version = "0.15.1", features = ["serde", "shred-derive"] }
quote = "1.0.2"
syn = { version = "1.0.13", features = ["full", "extra-traits"] }
proc-macro2 = "1.0.7"
package org.apache.beam.examples.usercount.transformexample;
import com.google.cloud.firestore.Firestore;
import com.google.cloud.firestore.FirestoreOptions;
import com.google.cloud.firestore.WriteBatch;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import org.apache.beam.examples.usercount.domain.ProgressEvent;
package org.apache.beam.examples.usercount;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import java.io.Serializable;
import org.apache.beam.examples.usercount.ChangeStateTraker.ChangeResult;
import org.apache.beam.sdk.coders.AvroCoder;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.coders.DefaultCoder;
import org.apache.beam.sdk.state.StateSpec;
@ytaras
ytaras / Log
Created May 8, 2018 07:37
ltree resolve
2018-05-08 07:31:21.892 UTC [33] LOG: duration: 924169.808 ms plan:
Query Text: create temporary table resolved_by_ltree as
select rule_id, rule_pcd, product_leaf_pcd, location_leaf_pcd from
(select
rule_id,
rule_pcd,
product_leaf_pcd,
location_leaf_pcd,
row_number()
over (
@ytaras
ytaras / Links
Last active August 29, 2015 14:11
Preparing for Presentation
@ytaras
ytaras / basic.rb
Last active December 22, 2015 16:09
# Dynamic typing
if false
"".foo
end
# Strong typing
[] + {}
{} + []
{} + ""
[] + ""
-- [x] Get input from user
-- [x] Do it only every two seconds
-- [x] Filter output < 3
-- [x] Send request to server
-- [x] Display results to user
import Graphics.Input as Input
import Maybe
import Http as H
import Json as J
@ytaras
ytaras / gist:6362691
Last active December 21, 2015 20:39
Wip for TODO in Elm
import Graphics.Input as Input
import Text as T
import Keyboard as K
-- utility
ith : Int -> [a] -> a
ith index = head . drop index
replaceIth : [a] -> Int -> (a -> a) -> [a]
@ytaras
ytaras / gist:6352927
Last active December 21, 2015 19:18
React on user input only after some amount of time
import Graphics.Input as Input
(hashTagField, rawHashTag) = Input.field "Type your hash tag"
main = fields
fields = above <~ hashTagField ~ (asText <~ hashTag)
hashTag : Signal String
hashTag = delayed (2*second) [] rawHashTag
@ytaras
ytaras / Env.hs
Created July 8, 2013 16:32
Getting environment variable in type-safe and composable way
module Env where
import System.IO.Error (isDoesNotExistError)
import GHC.IO.Exception (IOException)
import System.Environment (getEnv)
import Control.Monad.Error (catchError, Error, ErrorT)
import Control.Monad ((>=>), liftM)
-- Error handler
data GenericError =
-- wrapper for IOExceptions