Skip to content

Instantly share code, notes, and snippets.

View madnight's full-sized avatar
💭
One does not so much learn category theory as absorb it over time.

Fabian Beuke madnight

💭
One does not so much learn category theory as absorb it over time.
View GitHub Profile
@madnight
madnight / active-issues.sql
Created September 21, 2017 09:32 — forked from alysonla/active-issues.sql
Queries that power the open source section of the 2016 Octoverse report https://octoverse.github.com/
-- Active issues
-- Count of total active issues in the specified time frame
-- Source: githubarchive public data set via Google BigQuery http://githubarchive.org/
SELECT
COUNT(DISTINCT JSON_EXTRACT_SCALAR(events.payload, '$.issue.id')) AS events_issue_count
FROM (SELECT * FROM TABLE_DATE_RANGE([githubarchive:day.],TIMESTAMP('2015-09-01'),TIMESTAMP('2016-08-31')))
AS events
-- 10,723,492 active issues
@madnight
madnight / hn-aeson.hs
Created September 30, 2016 15:23 — forked from Gonzih/hn-aeson.hs
Aeson HN example of nested JSON (unoptimized binary ~20 mb)
{-# LANGUAGE OverloadedStrings #-}
import Data.Aeson
import Control.Applicative ((<$>), (<*>))
import Control.Monad (mzero)
import Network.HTTP.Conduit
import Data.ByteString.Lazy.Internal (ByteString(..))
data Item = Item { title :: String
, url :: String