Skip to content

Instantly share code, notes, and snippets.

@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 / StreamOuter.scala
Created February 27, 2016 02:32 — forked from john-kurkowski/StreamOuter.scala
Scala closures capture outer variables, which can lead to unhappy serialization when you don't expect a lazy data structure under the covers. The lesson is, for serialization, favor strict, concrete types.
class A
class B extends Serializable
val baos = new java.io.ByteArrayOutputStream(1024)
val oos = new java.io.ObjectOutputStream(baos)
val streamSurprise: Seq[A] = Stream.fill(3)(new A) // say you don't know it's a Stream under the covers
val transformation = streamSurprise map (a => new B)
oos.writeObject(transformation) // fails due to NotSerializableException: A
@cfchou
cfchou / 0_reuse_code.js
Created December 7, 2013 01:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console