This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
import requests | |
import re | |
def get_license(package_name): | |
"""Find the license of an NPM package, come hell or high water.""" | |
url = "https://registry.npmjs.org/{}".format(package_name) | |
resp = requests.get(url).json() | |
def read_license(license_): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
pkgs ? import <nixpkgs> {}, | |
compiler ? "ghc7102" | |
}: | |
import ./project.nix { | |
inherit pkgs; | |
haskellPackages = pkgs.pkgs.haskell.packages."${compiler}"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{cmp}; | |
type ParseResult<T> = Result<T, String>; | |
// Parse a string containing any number of balanced parentheses | |
// groups. For example these are valid: | |
// | |
// () => 1 group, max depth 1 | |
// (())() => 2 groups, max depth 2 | |
// (()()()(())()) => 1 group, max depth 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | Optionally set up a reverse HTTP proxy to a ghcjsi server. | |
-- | |
-- The idea here is that you are working on an application which has a | |
-- GHCJS frontend and a GHC backend. The backend delivers the front-end | |
-- JavaScript to the browser, and also provides some kind of REST API | |
-- which the frontend uses. The API server is assumed to be the same | |
-- server which serves the frontend code, so that you don't need to set | |
-- up CORS. | |
-- | |
-- When developing on your front-end code, you want to be able to rapidly |
OlderNewer