Skip to content

Instantly share code, notes, and snippets.

Avatar

kanishka-work

View GitHub Profile
View gist:c04c7994370e12e40efdd2b3d075ffa1
swagger: "2.0"
info:
description: "This api allows for retrieving, manipulating data related to volumes on databrary.org as well as uploading and downloading of files in volumes."
version: "1.0.0"
title: "Databrary"
host: "dev3.databrary.org:8000"
basePath: "/api"
tags:
- name: "session"
schemes:
View dbrary-swagger1.yaml
swagger: "2.0"
info:
description: "This api allows for retrieving, manipulating data related to volumes on databrary.org as well as uploading and downloading of files in volumes."
version: "1.0.0"
title: "Databrary"
host: "databrary.org"
basePath: "/api"
tags:
- name: "session"
schemes:
View gist:a0f4bebbb04500b816a22dfa691b966f
# 16 GB hardrive (Red Hat, 64 bit VM), use centos-minimal or centos-dvd and network on
# all of these commands should be run as root (except obviously when you change to the user)
sudo yum install epel-release -y
sudo yum update -y
sudo reboot now
# wait 10 secs, reconnect via ssh
# install yum-utils for config manager
View gist:ed6e02407a236882094fe99818da5627
GET-----
open:
curl 'http://192.168.1.7:8642/api/swagger' | jq .
-- cite needs url=... TODO
curl 'http://192.168.1.5:8642/asset/formats?js=0' # open w
curl -v 'http://192.168.1.5:8642/party/0/avatar' # open with browser or lynx to view
curl 'http://192.168.1.5:8642/api/constants' | jq .
curl 'http://192.168.1.5:8642/robots.txt'
curl 'http://192.168.1.5:8642/api/tags' | jq .
curl 'http://192.168.1.5:8642/api/tags/eye' | jq .
View centos-vm-build
# VM: 16 GB hardrive (Red Hat, 64 bit VM), use centos-minimal or centos-dvd and network on
# DEV: > 12 GB, preferably much more, use some centos7 ami
# all of these commands should be run as root (except obviously when you change to the user)
sudo yum install epel-release -y
sudo yum update -y
sudo reboot now
# wait 10 secs, reconnect via ssh
@kanishka-work
kanishka-work / gist:8aedf6444df01a5cd792b8adfc2f39d1
Last active Aug 31, 2017
Building up to comfort in reading Databrary's usage of Haskell for front end developer
View gist:8aedf6444df01a5cd792b8adfc2f39d1
1. Transition from imperative and simple type systems to functional/immutable and complex type system.
- For building up comfort with immutability, if one has prior knowledge of Javascript, you can try using some Javascript libraries that provide aspects of functional programming
- immutable collections (https://facebook.github.io/immutable-js/)
- functional style (http://ramdajs.com/)
- more complex types and patterns (https://github.com/fantasyland/fantasy-land) - SKIM, very superficially
2. Build up more comfort with moderately complex type system and immutable values
- Elm examples (http://elm-lang.org/examples) and guide (https://guide.elm-lang.org/, http://elm-lang.org/docs/syntax, http://elm-lang.org/docs/from-javascript)
View gist:885fbe94519007d9e34094f7ada3e7f1
Goal: theory, algs, crypto, randomized
proof systems zk/pcp: libsnark
randomized algs/ds: bloom filter
pseudorandomnes/extractors:
derandomization/graph expanders/online graph algs: ?
circuit complexity:
approx algs:
reed solomon codes/ecc:
applied - TSP: arora alg
View gist:e17b4bc074150e4e1810fbca9c6b4306
new util: find + read cabal file only
utils:
- cabalQuery (reviewed), cabalish (done) - dump values of top level fields
- cabal-lenses <<
- cabal-info (reviewed)
- package-description-remote
- cabal-cargs - dump compiler args
- cabal-plan - read nix style plan.json (done)
- cabal2ghci - gen ghci and stylish-haskell files
@kanishka-work
kanishka-work / Makefile.erb
Last active Apr 26, 2017
Simple CI Makefile template, stack haskell
View Makefile.erb
# generates Makefile with the following options:
# - all resolvers (is_general_purpose == true) or nightly only (is_general_purpose == false)
# - generate stack.yaml (generate_stack == true) or leave manual stack.yaml in place (generate_stack == false)
# - generate default int-test-full target (default_int_test == true)
# - project name to use for qualifying integration-tests flag
# ruby Makefile.erb IS_GENERAL_PURPOSE GENERATE_STACK DEFAULT_INT_TEST PROJECT_NAME
# i.e. ruby Makefile.erb true true true lib1 > Makefile
require 'erb'
is_general_purpose = ARGV[0]
@kanishka-work
kanishka-work / Manage.md
Last active Apr 26, 2017
Managing a few dozen small Haskell packages, mixture of closed/open source
View Manage.md

For each core Haskell library or executable, one has to manage the following:

  1. Unit test - automated running, notification of failures
  2. Integration test - automated running, notification of failures
  3. Dependency updates - automated tracking of updates in libraries used (aeson, etc), upgrade when new versions published
  4. Compiler/core library version upgrades - automated periodic checks, notification of failures, automatically or manually upgrade compiler/core library version used
  5. Release versions - specific snapshots of source code with a version label
  6. Manage downstream references to the library - update version referenced, provide channel for downstream libraries to download and build released version
  7. Fix bugs
  8. Widespread usage, installation - exercise corner cases