Skip to content

Instantly share code, notes, and snippets.

Avatar
🇨🇳
saas.launch("QIMAone")

Cyril Lakech clakech

🇨🇳
saas.launch("QIMAone")
View GitHub Profile
@clakech
clakech / SpyAndMockFailTest
Created Apr 11, 2012
Why Mockito @SPY and @mock doesn't work together ?
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;
@clakech
clakech / jenkinsPrerequisites.sh
Last active Dec 17, 2015
Prerequisites for jenkins Cloudbees nodejs,grunt,bower,ruby,compass build
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 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 gist:34aef266419a1bd9c131
{
id: "4d49ca82",
model: {
href: "/foundation/v2/modelTypes/Product/models/140"
}
attribute: [
{
href: "/foundation/v2/attributes/title",
value: [
"Find the rabbit"
@clakech
clakech / exercise.tour.go
Last active Aug 29, 2015 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
View exercise.tour.go
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@clakech
clakech / README.md
Last active Jun 22, 2017
(Spark + Cassandra) * Docker = <3
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

@clakech
clakech / csv2csvStream.js
Created Feb 23, 2018
parse stream csv file to create another csv file with only vanilla NodeJS (readline)
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 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');