Skip to content

Instantly share code, notes, and snippets.

View c4urself's full-sized avatar

Christian Verkerk c4urself

  • Tubular Labs
  • Mountain View
View GitHub Profile
@c4urself
c4urself / theme_override.dart
Created May 21, 2020 17:16
theme_override.dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
/// Overrides the default Theme to force a light app bar
class LightAppBarOverride extends StatelessWidget
implements PreferredSizeWidget {
const LightAppBarOverride({this.child});
final AppBar child;
@override
Widget build(BuildContext context) {
import asyncio
import tornado
from tornado import gen, ioloop
SLEEPY = 0.2
async def native_coroutine():
print('hi from native')
await asyncio.sleep(SLEEPY)
@c4urself
c4urself / bazel_talk_02.py
Created April 4, 2018 18:17
Bazel Talk 02
pex_binary(
name = "ingestion",
main = "manage.py",
deps = [
"//pkg-rubberband:rubberband",
]
)
@c4urself
c4urself / bazel_talk_01.py
Created April 4, 2018 17:45
Bazel Talk 01
pex_library(
name = "rubberband",
srcs = glob(["rubberband/**/*.py"]),
reqs = [
third_party_req("lazy"),
third_party_req("tornado"),
third_party_req("ujson"),
],
deps = [
"//pkg-mon:mon",
#!/usr/bin/env python
import re
import sys
keyspace, table, size_in_gb = 'unknown', 'unknown', 0.0
for line in sys.stdin.readlines():
if 'Keyspace:' in line:
m = re.search(r'Keyspace: (?P<keyspace>\w+)', line)
keyspace = m.group('keyspace')
@c4urself
c4urself / terraform.sh
Created September 28, 2016 20:50
Wrapper around Terraform
#!/bin/sh
set -e
TERRAFORM_BUCKET_REGION='us-east-1'
TERRAFORM_BUCKET_NAME=''
TERRAFORM_VERSION="0.7.4"
actions="plan apply fmt plan-destroy destroy refresh graph validate"

Keybase proof

I hereby claim:

  • I am c4urself on github.
  • I am c4urself (https://keybase.io/c4urself) on keybase.
  • I have a public key ASBaqM5prpaQZAoTI4cL1wNlBEMYaRPAHyenuaahYJRxpAo

To claim this, I am signing this object:

PULL=$( echo $BRANCH | awk -F/ '{ print $3 }' )
html_url=https://api.github.com/repos/Tubular/$PROJECT/pulls/$PULL/commits
LINK=https://github.com/Tubular/$PROJECT/pull/$PULL
USER=$(curl $html_url?access_token=$GITHUB_TOKEN | python -c 'import json,sys;obj=json.load(sys.stdin);print obj[0]["commit"]["author"]["name"]')
curl -H "Content-Type: application/json" -d "{\"fallback\": \"Jenkins Pull-Request Publisher\", \"channel\": \"#deploys\", \"icon_emoji\": \":vertical_traffic_light:\", \"color\": \"#f2144b\", \"fields\": [{\"title\": \"$USER updated a pull-request in $PROJECT\", \"value\": \"<$LINK|$LINK>\", \"short\": false}]}" https://tubular.slack.com/services/hooks/incoming-webhook?token=$SLACK_TOKEN
@c4urself
c4urself / tagging_instances.tf
Created June 8, 2016 17:50
How to dynamically tag instance via a module in Terraform?
variable "ami_id" { }
variable "subnet_id" { }
variable "security_group_id" { }
variable "key_name" { }
variable "instance_profile" { }
variable "instance_type" { }
variable "instance_name" { }
variable "hostname" { }
variable "tag_role" { }
variable "tag_cost_environment" { }
@c4urself
c4urself / toptip3.md
Created May 24, 2016 15:33
time drift issue between vagrant/virtual box

Discovered a time drift issue between the vagrant/virtualbox vm and the host:

root@82879b06345b:/opt/tubular/s3debbie# telnet s3.amazonaws.com 80 Trying 54.231.16.136... Connected to s3-1.amazonaws.com. Escape character is '^]'. GET / HTTP/1.1

HTTP/1.1 400 Bad Request Transfer-Encoding: chunked