Skip to content

Instantly share code, notes, and snippets.

Avatar
🕺

Fayi FB fayimora

🕺
View GitHub Profile
View gitlab-ci.yml
image: node:12
stages:
- prepare
- test
services:
- selenium/standalone-chrome
prepare:
stage: prepare
script:
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright (C) 2019 Google Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License"); you may not
~ use this file except in compliance with the License. You may obtain a copy of
~ the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.euromonitor</groupId>
<artifactId>Via-Dataflow-Service</artifactId>
<version>1.0-SNAPSHOT</version>
View run.sh
#!/usr/bin/env bash
# Pipeline vars
PROJECT=my-project
BUCKET_NAME=my-bucket
TABLE={$PROJECT}:my-dataset.my-table
NODE_ADDRESSES=comma-separated-list-nodes
INDEX=my-index
DOCUMENT_TYPE=my-type
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.euromonitor</groupId>
<artifactId>Via-Dataflow-Service</artifactId>
<version>1.0-SNAPSHOT</version>
View arda-d3.js
// Define the size of the canvas above so we can re-use it later to generate co-ordinates
var width = 1000;
var height = 1000;
// create our canvas
var canvas = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
// Helper function to help generate coords.
View spring-redis.conf
spring.redis.cluster.max-redirects= # Maximum number of redirects to follow when executing commands across the cluster.
spring.redis.cluster.nodes= # Comma-separated list of "host:port" pairs to bootstrap from.
spring.redis.database=0 # Database index used by the connection factory.
spring.redis.url= # Connection URL, will override host, port and password (user will be ignored), e.g. redis://user:password@example.com:6379
spring.redis.host=localhost # Redis server host.
spring.redis.password= # Login password of the redis server.
spring.redis.ssl=false # Enable SSL support.
spring.redis.pool.max-active=8 # Max number of connections that can be allocated by the pool at a given time. Use a negative value for no limit.
spring.redis.pool.max-idle=8 # Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
spring.redis.pool.max-wait=-1 # Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the
View Serialization.scala
import java.io.{ByteArrayInputStream, ByteArrayOutputStream, ObjectInputStream, ObjectOutputStream}
object Serialization extends App {
def serialise(value: Any): Array[Byte] = {
val stream: ByteArrayOutputStream = new ByteArrayOutputStream()
val oos = new ObjectOutputStream(stream)
oos.writeObject(value)
oos.close
stream.toByteArray
View .spacemacs.el
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
View wat.scala
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
val x = 5
val y = 6
def makeFuture(text: String) = Future { println(text) }
for {
foo <- makeFuture("hi") if x == 5
bar <- makeFuture("yo") if y == 4