Skip to content

Instantly share code, notes, and snippets.

View tomaslin's full-sized avatar

Tomás Lin tomaslin

  • Netflix
  • San Jose, CA
View GitHub Profile
In a quaint little house on the edge of a hill,
Lived old Mr. Grindle, with a will and a thrill.
His home was a clutter of memories and dust,
A place where the past had a grand, cozy trust.
With a broom in his hand, made of straw and worn wood,
He began his sweeping, as old men should.
His hair was like snow, his beard was like fleece,
His eyes twinkled with tales, his laughter - a feast.
“Off with you, dust!” he’d chuckle and say,
As he danced with his broom in a whimsical way.
@tomaslin
tomaslin / gist:311a9340ef250d9232e9ed6f5fcdad36
Created February 14, 2025 20:10
Prompt for Grok to generate story
You're a cool fiction writer that writes in fun, soft verses with deep funny characters, write a scene where a old man is sweeping his home
continue the story, his neighboor comes over and they have some tea together, she tells him about a great pain she's feeling lately
continue the story, he helps her with her issue
finish the story, she thanks him
@tomaslin
tomaslin / ValidateSchemaSpec.groovy
Created January 10, 2020 22:21
A spock test that validates schemas
package com.netflix.mce.schemavalidator
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
import com.networknt.schema.JsonSchemaFactory
import com.networknt.schema.SpecVersion
import spock.lang.Shared
import spock.lang.Specification
import spock.lang.Unroll
@tomaslin
tomaslin / ProtoDiff.groovy
Last active March 20, 2019 23:41
Simple diff for shaded proto messages in Java/Grpc
// Usage: diff(Message, OtherMessage).empty
def diff(x, y) {
deepEquals(x.newBuilder().build().getDescriptorForType().fields,
y.newBuilder().build().getDescriptorForType().fields)
}
def deepEquals(List<FieldDescriptor> fields1, List<FieldDescriptor> fields2) {
if (fields1.size() != fields2.size()) {
return ["Missing field between ${fields1*.name} and ${fields2*.name}"]
@tomaslin
tomaslin / versions.md
Last active March 19, 2016 08:16
Latest Netflix Spinnaker Versions

Generated Sat Mar 19 08:16:09 UTC 2016

package version
clouddriver 1.99.0
deck 2.544.0
echo 1.94.0
front50 1.8.0
gate 2.43.0
igor 1.17.0
@tomaslin
tomaslin / gist:96bd8108688ea9308daa
Created November 8, 2014 00:22
Docker calls via Spotify Docker client
@Grapes(
@Grab(group='com.spotify', module='docker-client', version='2.7.0')
)
import com.spotify.docker.client.messages.*
import com.spotify.docker.client.DefaultDockerClient
import com.spotify.docker.client.DockerClient
DockerClient docker = new DefaultDockerClient('myinstace')
@tomaslin
tomaslin / gist:e877b98b353f47167dbe
Created November 7, 2014 22:41
Docker calls with Docker Java client
@Grapes(
@Grab(group='com.github.docker-java', module='docker-java', version='0.10.3')
)
import com.github.dockerjava.api.DockerClient
import com.github.dockerjava.core.DockerClientConfig
import com.github.dockerjava.core.DockerClientBuilder
import com.github.dockerjava.api.command.CreateContainerResponse
DockerClientConfig config = DockerClientConfig.createDefaultConfigBuilder()
@tomaslin
tomaslin / boogerfarts
Created August 1, 2014 16:28
Why u no work
@GrabResolver(name='clojars.org', root='http://clojars.org/repo')
@Grab('redis.embedded:embedded-redis:0.2')
@Grab('redis.clients:jedis:2.2.1')
@Grab('org.apache.ivy:ivy:2.3.0')
import redis.clients.jedis.Jedis
import redis.clients.jedis.JedisCommands
import redis.clients.jedis.JedisPool
import redis.clients.jedis.JedisPoolConfig
import redis.clients.jedis.Protocol
@tomaslin
tomaslin / gist:0f9b07654c51b19b6089
Created June 20, 2014 07:24
force a dependency version
def rxJavaVersion = '0.16.1'
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'com.netflix.rxjava') {
details.useVersion rxJavaVersion
}
}
}
curl -s get.gvmtool.net | bash
cd ~/.gvm/grails
curl -O -k https://dist.springframework.org.s3.amazonaws.com/milestone/GRAILS/grails-2.4.0.M1.zip
unzip grails-2.4.0.M1.zip
rm grails-2.4.0.M1.zip
gvm install grails 2.4.0.M1 grails-2.4.0.M1
gvm use grails 2.4.0.M1