Skip to content

Instantly share code, notes, and snippets.

View alexrios's full-sized avatar
🦎
Zigging around

Alex Rios alexrios

🦎
Zigging around
View GitHub Profile
@j-didi
j-didi / Main.kt
Last active June 11, 2020 21:23
Kotlin Domain Specific Language using reflections, infix and aggregation
import com.google.gson.GsonBuilder
import kotlin.reflect.KMutableProperty
import kotlin.reflect.full.memberProperties
//Enum and properties to better infix semantic
private const val Terminal = 0
enum class LogTarget(val value: Int) {
TERMINAL(0);
@j-didi
j-didi / Main.kt
Last active June 9, 2020 21:25
Kotlin simple functions delegate implementation example
import java.time.LocalDate
//Domain entity, command an result from CQRS
data class Person(val id: Int, val name: String, val createdAt: LocalDate, val updateAt: LocalDate)
data class PersonCommand(val name: String)
data class PersonResult(val id: Int, val name: String)
//Repository, Logger and Mapper abstractions
interface Repository<T> { fun insert(entity: T) : T }
@maciekrb
maciekrb / PubSub to BigQuery using Dataflow
Created December 25, 2017 12:25
Dataflow pipeline to read from a Google Pub/Sub topic and write into a BigQuery table
package com.healthifyme.dftrial;
import com.google.api.services.bigquery.model.TableRow;
import com.google.api.services.bigquery.model.TableSchema;
import com.google.api.services.bigquery.model.TableFieldSchema;
import com.healthifyme.dftrial.common.ExampleUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
@dtjm
dtjm / join_test.go
Last active November 26, 2023 13:18
Benchmarking various ways of concatenating strings in Go
package join
import (
"fmt"
"strings"
"testing"
)
var (
testData = []string{"a", "b", "c", "d", "e"}
@bradleypeabody
bradleypeabody / gist:185b1d7ed6c0c2ab6cec
Last active November 29, 2023 22:08
golang, convert UTF-16 to UTF-8 string
package main
// http://play.golang.org/p/fVf7duRtdH
import "fmt"
import "unicode/utf16"
import "unicode/utf8"
import "bytes"
func main() {
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@bric3
bric3 / install_jdk5_post_lion.sh
Last active April 18, 2023 06:50
Automate the install of JDK 5 on Lion, Mountain Lion, Mavericks
# _______ _ _ _ _ _
# |__ __| | (_) (_) | | | |
# | | | |__ _ ___ ___ ___ _ __ _ _ __ | |_ _ __ ___ _____ _____ __| |
# | | | '_ \| / __| / __|/ __| '__| | '_ \| __| | '_ ` _ \ / _ \ \ / / _ \/ _` |
# | | | | | | \__ \ \__ \ (__| | | | |_) | |_ | | | | | | (_) \ V / __/ (_| |
# |_| |_| |_|_|___/ |___/\___|_| |_| .__/ \__| |_| |_| |_|\___/ \_/ \___|\__,_|
# | |
# |_|
#
# New home : https://github.com/bric3/osx-jdk5-installer