Skip to content

Instantly share code, notes, and snippets.

View tylerprete's full-sized avatar

Tyler Prete tylerprete

  • Boulder, CO
  • 08:17 (UTC -07:00)
View GitHub Profile
import mill._
import mill.scalalib._
import mill.scalajslib._
import mill.scalanativelib._
object shared extends mill.Cross[SharedModule]("2.11.12", "2.12.4")
class SharedModule(val crossScalaVersion: String) extends CrossScalaModule with ScalaJSModule with ScalaNativeModule {
def scalaJSVersion = "0.6.22"
def scalaNativeVersion = "0.3.8"
Verifying my Blockstack ID is secured with the address 18Xgt7rY4W92ZLJjFxh3p3tFPCk5dZeSSR https://explorer.blockstack.org/address/18Xgt7rY4W92ZLJjFxh3p3tFPCk5dZeSSR
@tylerprete
tylerprete / rinkeby.txt
Created September 9, 2017 02:16
Rinkeby Public Key
0x899d20dc42A3AAC00805b0250D9B6b46Ff647810
package com.failing
import com.github.pathikrit.dijon.parse
object SimpleFailingTest {
def main(args: Array[String]) {
val d = parse( """{"name": {"title": "Rat"}}""")
val title: Option[String] = d.name.title.as[String]
val lowerTitle = title map {
@tylerprete
tylerprete / working_redis_lock.py
Created May 7, 2014 21:59
Working redis_lock usage
from __future__ import print_function
from redis import StrictRedis
from redis_lock import Lock
# Whereas here, we create a new instance each time...
def main():
_conn = StrictRedis()
with Lock(_conn, "redis_lock"):
print("one")
@tylerprete
tylerprete / broken_redis_lock.py
Created May 7, 2014 21:57
Broken redis_lock usage
from __future__ import print_function
from redis import StrictRedis
from redis_lock import Lock
# When using normal locks, you only want one instance...
def main():
_conn = StrictRedis()
_lock = Lock(_conn, "redis_lock")
with _lock:
@tylerprete
tylerprete / validation_patch.patch
Created April 9, 2013 00:28
Patch that works with homebrew thrift 0.90 to add proper validation support to generated python classes.
From d3f1d5c2dc2b0e5c238df1548fe9f5bd4748d0cf Mon Sep 17 00:00:00 2001
From: kamilsalas <[email protected]>
Date: Sun, 9 Dec 2012 23:48:56 +0100
Subject: [PATCH] THRIFT-1732: Thrift should provide deep-validation of
structures
---
compiler/cpp/src/generate/t_py_generator.cc | 160 ++++++++++++++++++++--
lib/py/src/Thrift.py | 26 +++-
lib/py/src/protocol/TBase.py | 55 +++++++-