Skip to content

Instantly share code, notes, and snippets.

View calvernaz's full-sized avatar

Cesar Alvernaz calvernaz

View GitHub Profile
@calvernaz
calvernaz / FluentImmutableList.java
Last active February 2, 2017 09:48
Fluent Immutable List
package com.util.collections;
import static com.google.common.collect.FluentIterable.from;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
package com.hikari.datasource;
import com.zaxxer.hikari.HikariConfig;
public class EncryptedHikariConfig extends HikariConfig {
private String encryptionKey;
public String getEncryptionKey() {
return encryptionKey;
package com.jackson.utils;
import java.io.IOException;
import java.util.*;
import org.apache.commons.lang3.StringUtils;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
package com.util.filesystem;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
@calvernaz
calvernaz / README.md
Last active February 24, 2018 20:57
Jetson TX2 - Flash and Install Development Kit

Intro

Let's directly to the points without emphesizing how usually people get frustrated on flashing JetPack into NVIDIA TX2 without access to an actually Ubuntu machine.

Therefore, this is all about how to flash into TX2 with an VM (VirtualBox) on Mac.

1. Pre-requisites

  • A mac desktop connected with Wi-Fi
@calvernaz
calvernaz / gist:07fada864bab5e419afd29a328717fe1
Last active June 16, 2018 09:35
Debug GAE using Go and Goland IDE
1. tar xfvz google-cloud-sdk-204.0.0-darwin-x86_64.tar.gz
2. ./google-cloud-sdk/install.sh
3. source ~/.config/fish/config.fish
4. gcloud init
5. gcloud components install app-engine-go
@calvernaz
calvernaz / main.go
Created December 29, 2018 22:30
ticker set
package main
import (
"fmt"
"log"
"os"
"os/signal"
"syscall"
"time"
"math/rand"
package flatten
// FlattenCopy flattens array of integers
// using the built-in copy function
func FlattenCopy(arr [][]int) []int {
r := make([]int, len(arr))
i := 0
for _, a := range arr {
if len(a) + i <= cap(r) {
copy(r[i:], a)
package org.weirdloop;
import org.jctools.queues.atomic.SpscAtomicArrayQueue;
import java.util.Collection;
import java.util.Timer;
import java.util.TimerTask;
import java.util.function.Consumer;
class BatchQueue<T> {

Keybase proof

I hereby claim:

  • I am calvernaz on github.
  • I am calvernaz (https://keybase.io/calvernaz) on keybase.
  • I have a public key whose fingerprint is 2A50 B47F A574 981D 978C 7A04 5AA5 1692 F4F3 1D2D

To claim this, I am signing this object: