Skip to content

Instantly share code, notes, and snippets.

View chancez's full-sized avatar

Chance Zibolski chancez

View GitHub Profile
@e000
e000 / donotuse.py
Created June 13, 2011 23:30
How to NEVER use lambdas.
##########################################################
# How to NEVER use Lambdas. An inneficient and yet educa-#
# tonal guide to the proper misuse of the lambda constru-#
# ct in Python 2.x. [DO NOT USE ANY OF THIS EVER] #
# by: e000 (13/6/11) #
##########################################################
## Part 1. Basic LAMBDA Introduction ##
# Well, it's worth diving straight into what lambdas are.
# Lambdas are pretty much anonymous "one line" functions
@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

@robgolding
robgolding / filtering.py
Created November 17, 2012 16:44
Django Class-Based View Mixins: Part 2
class FilterMixin(object):
"""
View mixin which provides filtering for ListView.
"""
filter_url_kwarg = 'filter'
default_filter_param = None
def get_default_filter_param(self):
if self.default_filter_param is None:
raise ImproperlyConfigured(
@gregorynicholas
gregorynicholas / ndb_json_helpers.py
Created February 6, 2013 18:42
helper methods for working with appengine ndb models and dict / json serialization
from json import JSONEncoder, loads
from time import mktime
from datetime import date, datetime
from google.appengine.ext import ndb
from google.appengine.ext.ndb import query
def to_epoch(value):
"""
This is a view method to return the data in milli-seconds.
@chancez
chancez / v3api.go
Last active September 16, 2015 00:16
package clientv3
import "github.com/coreos/etcd/storage/storagepb"
// A KV executes etcd key-value operations
type KV interface {
Execute(KvOp) (*Response, error)
}
// A Txn executes multiple etcd operations atomically
@sandrinodimattia
sandrinodimattia / automate-login-page-email-templates.md
Last active April 8, 2019 18:26
Automatic configuration of the Auth0 Login Page and Email Templates

Customzing the Password Reset Page

Go to the API v2 explorer and generate a token with update:tenant_settings. Then call the tenants endpoint with the new HTML:

PATCH https://{YOUR_DOMAIN}/api/v2/tenants/settings

{
  "change_password": {
    "enabled": true,
@amaksoft
amaksoft / Jenkinsfile
Last active December 29, 2021 08:15
My example Jenkins Pipeline setup for Android app project
#!/usr/bin/groovy
/*
* Copyright (c) 2016, Andrey Makeev <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
@chancez
chancez / java
Last active December 9, 2016 02:15
#!/bin/bash -x
exec sudo rkt \
run \
--insecure-options=image,ondisk \
--inherit-env \
--volume dns,kind=host,source=/etc/resolv.conf \
--mount volume=dns,target=/etc/resolv.conf \
--volume jenkins,kind=host,source=/opt/jenkins,readOnly=false \
--mount volume=jenkins,target=/opt/jenkins \
@chancez
chancez / Jenkinsfile
Created December 16, 2016 22:09 — forked from amaksoft/Jenkinsfile
My example Jenkins Pipeline setup for Android app project
#!/usr/bin/groovy
/*
* Copyright (c) 2016, Andrey Makeev <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
@polvi
polvi / README.md
Created May 3, 2017 23:53
HDFS of Kubernetes

Easiest HDFS cluster in the world with kubernetes.

Inspiration from kimoonkim/kubernetes-HDFS

kubectl create -f namenode.yaml
kubectl create -f datanode.yaml

Setup a port-forward to so you can see it is alive: