Skip to content

Instantly share code, notes, and snippets.

View ku1ik's full-sized avatar
👋

Marcin Kulik ku1ik

👋
View GitHub Profile

Keybase proof

I hereby claim:

  • I am sickill on github.
  • I am sickill (https://keybase.io/sickill) on keybase.
  • I have a public key whose fingerprint is 42D4 E8CD 43BD 3BB8 EA3F 1EE0 9AA2 70F0 A59B 4381

To claim this, I am signing this object:

@ku1ik
ku1ik / play.rb
Last active August 29, 2015 14:24
The simplest asciicast player
# This plays asciicast (v1 format - https://github.com/asciinema/asciinema/blob/master/doc/asciicast-v1.md) in your terminal:
# ruby play.rb asciicast.json
require 'json'
JSON.parse(File.read(ARGV[0]))['stdout'].each do |frame|
sleep frame[0]
STDOUT.write frame[1]
STDOUT.flush
end
@ku1ik
ku1ik / asciinema.yml
Created June 23, 2015 20:52
asciinema site config file
smtp_settings:
:address: "smtp.gmail.com"
:port: 587
:enable_starttls_auto: true
:user_name: "joe@gmail.com"
:password: "8s7df7syfysu"
:authentication: :plain
:domain: "gmail.com"
(deftest changes-at-test
(let [frames [[2 :a] [4 :b] [6 :c]]]
(is (= (changes-at frames 0) nil))
(is (= (changes-at frames 1) nil))
(is (= (changes-at frames 2) :a))
(is (= (changes-at frames 3) :a))
(is (= (changes-at frames 4) :a))
(is (= (changes-at frames 5) :a))
(is (= (changes-at frames 6) :b))
(is (= (changes-at frames 7) :b))
> player.test_runner.runner()
core.cljs:116
Testing player.view-test
core.cljs:116
FAIL in (fg-color-test) (at http:21956:204)
core.cljs:116 expected: (= (v/fg-color 1 false) 111)
core.cljs:116 actual: (not (= 1 111))
core.cljs:116
Ran 6 tests containing 34 assertions.
core.cljs:116 1 failures, 0 errors.
Running ClojureScript test: test
Loading URL: env/test/unit-test.html
Running test.
Testing player.view-test
FAIL in (fg-color-test) (:)
expected: (= (v/fg-color 1 false) 111)
actual: (not (= 1 111))
~ % brew info asciinema
asciinema: stable 1.0.0 (bottled), HEAD
https://asciinema.org/
Not installed
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/asciinema.rb
==> Dependencies
Build: go ✘
@ku1ik
ku1ik / convert.rb
Last active November 30, 2015 12:42
Convert from asciinema "format 1 JSON" to asciinema "player JSON"
require 'json'
require 'open3'
class Hash
def slice *keys
select{|k| keys.member?(k)}
end
end
class Stdout

asciicast PNG test

alt

alt

FROM ubuntu:14.04
RUN apt-get -y update
RUN apt-get -y install nginx
ADD example.conf /etc/nginx/conf.d/example.conf
RUN echo "daemon off;" >>/etc/nginx/nginx.conf
EXPOSE 3000
CMD ["/usr/sbin/nginx"]