Skip to content

Instantly share code, notes, and snippets.

View mcbuddha's full-sized avatar

Marton Somogyi mcbuddha

View GitHub Profile
@mcbuddha
mcbuddha / stonks.clj
Last active February 4, 2021 12:18
stonks
#! /usr/bin/env nix-shell
#! nix-shell -p clojure -i "clj -Sdeps '{:deps {aleph/aleph {:mvn/version \"0.4.6\"} org.clojure/data.json {:mvn/version \"1.0.0\"} org.clojure/core.async {:mvn/version \"1.3.610\"}}}' -M"
(ns stonks
(:require [aleph.http :as http]
[manifold.stream :as s]
[clojure.data.json :as json]
[clojure.core.async :as async]))
(def stonk
"Transducer to accumulate updates to `etime` buckets.
0xdA8fb13f53EFBe47c772900Ff74EB3224D862c17

Keybase proof

I hereby claim:

  • I am mcbuddha on github.
  • I am marton (https://keybase.io/marton) on keybase.
  • I have a public key whose fingerprint is 9EF6 8589 B39C 8D8C 6E2C D95D 8B18 2C80 42E4 E0E4

To claim this, I am signing this object:

Loading auto-complete...done
Loading paren...done
Failed to enable theme: solarized-dark
For information about GNU Emacs and the GNU system, type C-h C-a.
user-error: Beginning of history; no preceding item
Contacting host: github.dev.pages:443
make-text-button: Odd length text property list
user-error: Beginning of history; no preceding item
Quit
> cat /tmp/screenly_xloader.log
Disabling screen power savings...
Launching infinite loop...
Cleaning up...
Cleaning up...
Cleaning up...
Cleaning up...
Cleaning up...
Traceback (most recent call last):
File "/home/pi/screenly/viewer.py", line 326, in <module>
[___,_] = [((x) -> console.log x), require 'lodash']
str_from_hex = (hex) -> (_.reduce '??'+hex, (a,b,c,d) -> a += String.fromCharCode parseInt b+d[c+1], 16 if c%2 is 0;a)[1..-1]
xorter = (a,b,i) -> a.charCodeAt(i) ^ b.charCodeAt(i)
masker = (a,b,i) -> _.size _.filter a, (c) -> c isnt b and (xorter b,c,i) in [65..90]
get_best = (a,i) -> _.last _.sortBy (_.collect a, (b) -> e:b, f:masker a,b,i), 'f'
crack = (a,c,t) -> _.collect c, (x,i) -> if (g=get_best a, i).f > t then String.fromCharCode 32 ^ xorter g.e,c,i else '_'
magic = (h_target, h_ciphers) ->
ciphers = _.collect h_ciphers, str_from_hex
class Scene
constructor: (@three_scene) ->
objects = {}
lights = {}
add_object: (name, value) ->
objects[name] = value
@three_scene.add value
get_object: (name) ->
objects[name]
del_object: (name) ->