Skip to content

Instantly share code, notes, and snippets.

View donald-pinckney's full-sized avatar

Donald Pinckney donald-pinckney

View GitHub Profile
@donald-pinckney
donald-pinckney / create_repo.sh
Created April 22, 2018 21:22
Create repo and push to GitHub
#!/bin/bash
token=$GITHUB_SCRIPT_TOKEN
private=true
has_issues=true
has_projects=true
has_wiki=true
otherData=""
shouldPush=1
@donald-pinckney
donald-pinckney / idris-vscode-setup.md
Created January 3, 2019 00:36
Idris Visual Studio Code Setup

To setup Idris with Visual Studio Code:

  1. Install Idris, clearly: https://www.idris-lang.org
  2. Follow the directions to install vscode-idris: https://github.com/zjhmale/vscode-idris
  3. In Visual Studio Code settings, set the executable path of Idris (obtained by which idris), and turn on Show Output When Typechecking
  4. In Visual Studio Code Keyboard Shortcuts menu, open keybindings.json, and add the following:
{
    "key": "ctrl+alt+c",
@donald-pinckney
donald-pinckney / function.idr
Last active March 26, 2019 23:28
Simple Hello World Idris Function
module MyFunction
hello : String -> String
hello req = "Hello: " ++ req
@donald-pinckney
donald-pinckney / function.idr
Created March 26, 2019 23:29
Idris Function Exported to JavaScript
module MyFunction
export -- This is new
hello : String -> String
hello req = "Hello: " ++ req
-- This is all new
lib : FFI_Export FFI_JS "" []
lib =
Fun hello "hello" $
@donald-pinckney
donald-pinckney / index.js
Created March 26, 2019 23:35
JavaScript Wrapper Code
const f = require('./function.js');
exports.gcf_main = function gcf_main(req, res) {
res.send(f.hello(req.body));
}

Keybase proof

I hereby claim:

  • I am donald-pinckney on github.
  • I am donaldpinckney (https://keybase.io/donaldpinckney) on keybase.
  • I have a public key ASBK2HEXJmXWh60lUd310Yhn_k9ATG3sdgRKvZAaJ5qzjAo

To claim this, I am signing this object:

@donald-pinckney
donald-pinckney / rosette-dates.rkt
Created February 14, 2023 20:44
Implementation of date arithmetic in Rosette
#lang rosette
(require rosette/lib/angelic)
(require (except-in rosette < <= -)
(prefix-in old (only-in rosette < <= -)))
(define-struct date [Y M D] #:transparent)
(define (is-leap-year Y) (and (= (remainder Y 4) 0) (=> (= (remainder Y 100) 0) (= (remainder Y 400) 0))))
(define (num-days Y M)