Skip to content

Instantly share code, notes, and snippets.

{
"basics": {
"name": "Thomas Edison",
"label": "Inventor and Businessman",
"picture": "https://example.com/photo.jpg",
"email": "[email protected]",
"phone": "(123) 456-7890",
"website": "https://thomasedison.com",
"summary": "Prolific inventor and businessman known for developing many devices that greatly influenced life around the world, including the phonograph, the motion picture camera, and the electric light bulb.",
"location": {
@cfchou
cfchou / cloudy-gamer-launcher.sh
Last active August 7, 2019 16:54 — forked from lg/cloudy-gamer-launcher.sh
Easily start/stop Paperspace and Parsec instances
#!/bin/bash
#
# CloudyGamerLauncher by Larry Gadea
# Easily start/stop Paperspace and Parsec instances
#
# Make sure to fill out the variables below. For the machine id, use the
# 8-letter identifier for the machine on Paperspace (ex. PS8RGDUY)
#
# Note: Requires Paperspace API key (generate one in account settings)
@cfchou
cfchou / rfc6749.md
Created August 31, 2018 00:08 — forked from yorkxin/rfc6749.md
RFC 6749 in Markdown - Edited from http://tools.ietf.org/rfc/rfc6749.txt
Internet Engineering Task Force (IETF)                     D. Hardt, Ed.
Request for Comments: 6749                                     Microsoft
Obsoletes: 5849                                             October 2012
Category: Standards Track
ISSN: 2070-1721

The OAuth 2.0 Authorization Framework

Abstract

@cfchou
cfchou / django-runserver-ssl.md
Last active August 30, 2018 03:34 — forked from claudiosanches/django-runserver-ssl.md
Django - SSL with runserver

Instalation

[sudo] apt-get install stunnel

Configuration

cd path/to/django/project
@cfchou
cfchou / waiters-2.json
Created January 10, 2018 08:58
athena waiters-2.json
{
"version": 2,
"waiters": {
"QuerySucceeded": {
"delay": 15,
"operation": "GetQueryExecution",
"maxAttempts": 40,
"acceptors": [
{
"expected": "SUCCEEDED",
package main
import (
"gopkg.in/cfchou/go-gentle.v3/gentle"
"context"
"math/rand"
"database/sql"
_ "github.com/mattn/go-sqlite3"
"fmt"
"time"

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

# vim:fileencoding=utf-8
import asyncio
import uvloop
from concurrent.futures import ProcessPoolExecutor
from concurrent.futures import ThreadPoolExecutor
import logging
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
@cfchou
cfchou / TypesSpec.scala
Last active May 31, 2016 06:17
test implicits
package types
import org.scalatest.{FlatSpec, Matchers}
// A couple of types which we can not modify
object ExistingTypes {
case class FrameA(id: Int, msg: String)
case class FrameB(id: Int, msg: String, property_b: String)
case class FrameC(id: Int, msg: String, property_c: Long)
}
@cfchou
cfchou / circular_ref.py
Created May 28, 2016 04:08
circular ref closure test
import random
import objgraph
from pympler import muppy, summary
import types
import logging
logging.basicConfig(level=logging.DEBUG)
class Dumb(object):