Skip to content

Instantly share code, notes, and snippets.

Yaron Minsky yminsky

View GitHub Profile
View gist:b5f41574fdfb1519e39f
$ opam upgrade -v
Everything as up-to-date as possible.
The following newer versions couldn't be installed:
- base-bytes.legacy is not available because it requires OCaml < 4.02.0.
- camlp4.4.03.0 is not available because it requires OCaml >= 4.03.0.
The following would require downgrades or uninstalls, but you may upgrade them explicitely:
- async.112.24.00
- async_extra.112.24.00
- async_kernel.112.24.00
- async_unix.112.24.00
View gist:2ca893014b17ac514e6c
$ opam install async_extra.112.24.00 --dry-run
The following actions will be performed:
- remove core_bench.112.17.00
- upgrade pa_ounit from 112.17.00 to 112.24.00 [required by async_extra]
- downgrade zarith from 1.3 to 1.2 [required by asn1-combinators]
- upgrade bin_prot from 112.17.00 to 112.24.00 [required by async_extra]
- upgrade sexplib from 112.17.00 to 112.24.00 [required by async_extra]
- recompile pa_bench.112.06.00 [uses pa_ounit]
- recompile uri.1.8.0 [uses sexplib]
- upgrade typerep from 112.17.00 to 112.24.00 [uses bin_prot]
View gist:ef29c8661dae7a011ce1
$ opam config report
# OPAM status report
# opam-version 1.2.0
# self-upgrade no
# os darwin
# external-solver aspcud
# criteria -count(removed),-notuptodate(request),-count(down),-notuptodate(changed),-count(changed),-notuptodate(solution)*
# jobs 6
# repositories 1* (http)
# pinned 1 (path)
yminsky / gist:5accb38dee5ce7b59e52
Created Apr 11, 2015
Attempt to Cabal install "implicit"
View gist:5accb38dee5ce7b59e52
~ $ \rm -rf .cabal
~ $ cabal install implicit
Config file path source is default config file.
Config file /Users/yminsky/.cabal/config not found.
Writing default configuration to /Users/yminsky/.cabal/config
Warning: The package list for '' does not exist. Run 'cabal
update' to download it.
cabal: There is no package named 'implicit'.
You may need to run 'cabal update' to get the latest list of available
yminsky / gist:1f8d17fb639a111c54eb
Created Apr 11, 2015
A better failure building implicit...
View gist:1f8d17fb639a111c54eb
~ $ cabal install implicit
Resolving dependencies...
Downloading Boolean-0.2.3...
Downloading NumInstances-1.4...
Configuring Boolean-0.2.3...
Downloading ansi-terminal-
Configuring NumInstances-1.4...
Downloading byteorder-1.0.4...
Configuring ansi-terminal-
Downloading mtl-
View gist:6082664b3ea074424c46
~ $ cabal install pandoc
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: pandoc-1.13.2 (user goal)
trying: base- (dependency of pandoc-1.13.2)
next goal: haddock-library (dependency of pandoc-1.13.2)
rejecting: haddock-library-1.2.0 (conflict: pandoc => haddock-library>=1.1 &&
rejecting: haddock-library-1.1.1, 1.1.0 (conflict:
base==, haddock-library => base>=4.3 && <4.8)
View gist:26d09128aec06d505e0a
Downloading semigroups-
Configuring semigroups-
Building semigroups-
Preprocessing library semigroups-
Ambiguous module name ‘Numeric.Natural’:
it was found in multiple packages:
nats-0.1.2@nats_1SlQ91QfEGVBnpiEUJoePq base-
Failed to install semigroups-
yminsky / gist:544fc49c6d9a932ba424
Created Apr 19, 2015
The code that sounds good.
View gist:544fc49c6d9a932ba424
void playTone(int tone, int duration) {
for (long i = 0; i < duration * 1000L; i += tone * 2) {
digitalWrite(speakerPin, HIGH);
yminsky / gist:f98996143e4631eb739b
Created Apr 19, 2015
This one sounds worse, but is non-blocking
View gist:f98996143e4631eb739b
void play_note(long tone, long start, long now) {
long gap = now - start;
long step = gap / tone;
boolean high = (step % 2 == 0);
if (high) { digitalWrite(speaker_pin, HIGH); }
else { digitalWrite(speaker_pin,LOW); }
View gist:8773a39663332ef00a50
#lang racket
(require web-server/servlet
(require pict)
(require file/convertible)
(require xml)
(define (pict->svg pict)
(define svg-b (convert pict 'svg-bytes))
You can’t perform that action at this time.