Skip to content

Instantly share code, notes, and snippets.

gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
ssl_certificate ssl-bundle.crt;
ssl_certificate_key ssl-private.key;
ssl_session_timeout 5m;
@mziwisky
mziwisky / Oauth2.md
Last active February 15, 2024 23:31
Oauth2 Explanation

OAUTH2

The Problem

I’m a web app that wants to allow other web apps access to my users’ information, but I want to ensure that the user says it’s ok.

The Solution

I can’t trust the other web apps, so I must interact with my users directly. I’ll let them know that the other app is trying to get their info, and ask whether they want to grant that permission. Oauth defines a way to initiate that permission verification from the other app’s site so that the user experience is smooth. If the user grants permission, I issue an AuthToken to the other app which it can use to make requests for that user's info.

Note on encryption

Oauth2 has nothing to do with encryption -- it relies upon SSL to keep things (like the client app’s shared_secret) secure.

@api-admin
api-admin / OAuth_developer_cheat_sheet.md
Created April 25, 2014 20:33
SurveyMonkey OAuth Developer Cheat Sheet

SurveyMonkey OAuth Developer Cheat Sheet

Authorization Flow

SurveyMonkey implements the authorization code grant framework of OAuth 2.0 as described in the RFC here: http://tools.ietf.org/html/rfc6749#page-24

 +-------------+ 
 |SurveyMonkey |   O

|Account | /|\

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 19, 2024 17:40
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

Setup your own win64 version of the Haskell Platform

Things you need to have

  • MSYS
  • GHC 7.8.2 win64 build
  • Cabal 1.20 win build
  • FreeGlut
@jozefg
jozefg / closconv.lhs
Last active May 5, 2024 19:23
Tutorial on Closure Conversion and Lambda Lifting
This is my short-ish tutorial on how to implement closures in
a simple functional language: Foo.
First, some boilerplate.
> {-# LANGUAGE DeriveFunctor, TypeFamilies #-}
> import Control.Applicative
> import Control.Monad.Gen
> import Control.Monad.Writer
> import Data.Functor.Foldable
@chrisdone
chrisdone / typing.md
Last active May 9, 2024 15:27
Typing Haskell in Haskell

Typing Haskell in Haskell

MARK P. JONES

Pacific Software Research Center

Department of Computer Science and Engineering

Oregon Graduate Institute of Science and Technology

@StephanHoyer
StephanHoyer / gist:bddccd9e159828867d2a
Last active March 29, 2022 11:46
Isomorphic applications with mithril

Attention

This post described how to create an application with mithril 0.2.x. Now that ver 1.0 is out, some things are a little differnent.

The example is updated with the current version of mithril, though.

Isomorphic applications with mithril

@wraithm
wraithm / monad.ml
Last active August 29, 2015 14:12
Monad with modular implicits
module type Functor = sig
type 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
end
let fmap (implicit F : Functor) = F.map
implicit module FunctorList = struct
type 'a t = 'a list
let map = List.map
@wraithm
wraithm / bifurcate.hs
Last active August 29, 2015 14:16
Bifurcate io-streams example
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad (when)
import Data.Maybe (isJust)
import Data.ByteString.Char8 as C
import System.IO.Streams as Streams