Skip to content

Instantly share code, notes, and snippets.

ru rocker ru-rocker

Block or report user

Report or block ru-rocker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ru-rocker
ru-rocker / Vagrantfile
Created Oct 15, 2018
Sample of Vagrantfile for GO CD setup
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "centos/7"
config.vm.provider "virtualbox" do |vb|
# Customize the amount of memory on the VM:
@ru-rocker
ru-rocker / gist:a61162964aac135c83ccd4af9a77dd0e
Created Dec 1, 2017
How to find corrupted jar files in local repo
View gist:a61162964aac135c83ccd4af9a77dd0e
find ~/.m2/repository/ -name "*jar" | xargs -L 1 zip -T | grep error | grep invalid
@ru-rocker
ru-rocker / DoublyLinkedList.java
Last active May 29, 2017
Implementation of DoublyLinkedList algorithm
View DoublyLinkedList.java
package com.rurocker.algo.ds;
/**
* DoublyLinkedList implementation
* Created by ricky on 5/29/17.
*/
public class DoublyLinkedList<E> {
private int size;
private Node<E> head;
@ru-rocker
ru-rocker / discovery.go
Last active Apr 15, 2017
Utility for consule service discovery
View discovery.go
package lorem_consul
import (
consulsd "github.com/go-kit/kit/sd/consul"
"github.com/go-kit/kit/log"
"os"
"github.com/hashicorp/consul/api"
"github.com/go-kit/kit/sd"
"math/rand"
"strconv"
@ru-rocker
ru-rocker / instrument.go
Created Apr 1, 2017
metrics middleware
View instrument.go
package lorem_metrics
import (
"github.com/go-kit/kit/metrics"
"time"
)
func Metrics(requestCount metrics.Counter,
requestLatency metrics.Histogram) ServiceMiddleware {
return func(next Service) Service {
@ru-rocker
ru-rocker / client_cmd_main.go
Last active Feb 20, 2017
lorem-grpc client command
View client_cmd_main.go
package main
import (
"flag"
"time"
"log"
grpcClient "github.com/ru-rocker/gokit-playground/lorem-grpc/client"
"google.golang.org/grpc"
"golang.org/x/net/context"
"github.com/ru-rocker/gokit-playground/lorem-grpc"
@ru-rocker
ru-rocker / client.go
Created Feb 20, 2017
lorem-grpc client builder
View client.go
package client
import (
"github.com/ru-rocker/gokit-playground/lorem-grpc"
"github.com/ru-rocker/gokit-playground/lorem-grpc/pb"
grpctransport "github.com/go-kit/kit/transport/grpc"
"google.golang.org/grpc"
)
// Return new lorem_grpc service
@ru-rocker
ru-rocker / server_grpc_main.go
Last active Feb 20, 2017
lorem-grpc server
View server_grpc_main.go
package main
import (
"net"
"flag"
"github.com/ru-rocker/gokit-playground/lorem-grpc"
context "golang.org/x/net/context"
"google.golang.org/grpc"
"github.com/ru-rocker/gokit-playground/lorem-grpc/pb"
"os"
@ru-rocker
ru-rocker / transport.go
Created Feb 20, 2017
lorem-grpc trasport layer
View transport.go
package lorem_grpc
import (
"golang.org/x/net/context"
grpctransport "github.com/go-kit/kit/transport/grpc"
"github.com/ru-rocker/gokit-playground/lorem-grpc/pb"
)
type grpcServer struct {
lorem grpctransport.Handler
@ru-rocker
ru-rocker / model.go
Created Feb 20, 2017
lorem-grpc model layer
View model.go
package lorem_grpc
import (
"context"
"github.com/ru-rocker/gokit-playground/lorem-grpc/pb"
)
//Encode and Decode Lorem Request
func EncodeGRPCLoremRequest(_ context.Context, r interface{}) (interface{}, error) {
req := r.(LoremRequest)
You can’t perform that action at this time.