View index.js
const express = require('express'); | |
const portfinder = require('portfinder'); | |
const { render } = require('url-to-pdf-api/src/core/render-core.js'); | |
const { Storage } = require("@google-cloud/storage"); | |
const storage = new Storage({}); | |
const getImage = async (path, bucketName) => storage.bucket(bucketName).file(path).createReadStream(); | |
const streamImage = async (path, imageId, bucketName, res) => { | |
res.set('Content-Type', 'image/jpg'); |
View csv2csvStream.js
const readline = require('readline'); | |
const fs = require('fs'); | |
const uuid = require('uuid/v4'); | |
const rl = readline.createInterface({ | |
input: fs.createReadStream('./input.csv'), | |
output: fs.createWriteStream('./output.csv'), | |
}); | |
rl |
View README.md
How to setup a cluster with Spark + Cassandra using Docker ?
Spark is hype, Cassandra is cool and docker is awesome. Let's have some "fun" with all of this to be able to try machine learning without the pain to install C* and Spark on your computer.
NOTE: Before reading, you need to know this was my first attempt to create this kind of cluster, I created a github projet to setup a cluster more easily here
Install docker and git
View exercise.tour.go
/* Exercise: Loops and Functions #43 */ | |
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := float64(2.) |
View gist:34aef266419a1bd9c131
{ | |
id: "4d49ca82", | |
model: { | |
href: "/foundation/v2/modelTypes/Product/models/140" | |
} | |
attribute: [ | |
{ | |
href: "/foundation/v2/attributes/title", | |
value: [ | |
"Find the rabbit" |
View cloudbees-node-installer.sh
#!/bin/sh | |
################################################################################ | |
# Copyright 2010-2011 CloudBees 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 jenkinsPrerequisites.sh
# prerequisites to install on jenkins before each build | |
export DISPLAY=:1 | |
Xvfb :1 & | |
# | |
# Fetch node, grunt, bower, npm deps, ruby for compass... | |
# | |
#cd $1 |
View SpyAndMockFailTest
package com.bla.web.controller; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.mockito.Mock; | |
import org.mockito.Spy; | |
import org.mockito.runners.MockitoJUnitRunner; | |
import com.bla.web.dto.FamilyAndItems; | |
import com.bla.web.service.FamilyServiceImpl; |