Skip to content

Instantly share code, notes, and snippets.

View clakech's full-sized avatar
🇨🇳
saas.launch("QIMAone")

Cyril Lakech clakech

🇨🇳
saas.launch("QIMAone")
View GitHub Profile
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');
@clakech
clakech / csv2csvStream.js
Created February 23, 2018 08:53
parse stream csv file to create another csv file with only vanilla NodeJS (readline)
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
@clakech
clakech / README.md
Last active June 2, 2021 12:38
(Spark + Cassandra) * Docker = <3

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

@clakech
clakech / exercise.tour.go
Last active August 29, 2015 14:26 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
{
id: "4d49ca82",
model: {
href: "/foundation/v2/modelTypes/Product/models/140"
}
attribute: [
{
href: "/foundation/v2/attributes/title",
value: [
"Find the rabbit"
#!/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
#
@clakech
clakech / jenkinsPrerequisites.sh
Last active December 17, 2015 06:09
Prerequisites for jenkins Cloudbees nodejs,grunt,bower,ruby,compass build
# prerequisites to install on jenkins before each build
export DISPLAY=:1
Xvfb :1 &
#
# Fetch node, grunt, bower, npm deps, ruby for compass...
#
#cd $1
@clakech
clakech / SpyAndMockFailTest
Created April 11, 2012 07:49
Why Mockito @SPY and @mock doesn't work together ?
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;