Skip to content

Instantly share code, notes, and snippets.

View flashingpumpkin's full-sized avatar
🏠
Working from home

Alen Mujezinovic flashingpumpkin

🏠
Working from home
View GitHub Profile
@flashingpumpkin
flashingpumpkin / uuid.kt
Created August 3, 2022 15:33 — forked from icedraco/uuid.kt
Kotlin UUID3 and UUID5 tool
/***
* Source:
* https://stackoverflow.com/questions/40230276/how-to-make-a-type-5-uuid-in-java
*/
import java.security.MessageDigest
import java.security.NoSuchAlgorithmException
import java.util.UUID
Error: global leak detected: _xdc_
at Runner.checkGlobals (http://192.168.1.102:8000/static/js/mocha/mocha.js:3138:21)
at Runner.<anonymous> (http://192.168.1.102:8000/static/js/mocha/mocha.js:3053:44)
at Runner.emit (http://192.168.1.102:8000/static/js/mocha/mocha.js:235:20)
at http://192.168.1.102:8000/static/js/mocha/mocha.js:3359:14
at Test.run (http://192.168.1.102:8000/static/js/mocha/mocha.js:3002:5)
at Runner.runTest (http://192.168.1.102:8000/static/js/mocha/mocha.js:3304:10)
at http://192.168.1.102:8000/static/js/mocha/mocha.js:3348:12
at next (http://192.168.1.102:8000/static/js/mocha/mocha.js:3232:14)
at http://192.168.1.102:8000/static/js/mocha/mocha.js:3241:7
from decimal import Decimal
from datetime import datetime
import time
from hummingbot.script.script_base import ScriptBase
from hummingbot.core.event.events import BuyOrderCompletedEvent, SellOrderCompletedEvent
from os.path import realpath, join
s_decimal_1 = Decimal("1")
LOGS_PATH = realpath(join(__file__, "../../logs/"))
@flashingpumpkin
flashingpumpkin / ffmpeg.sh
Last active February 22, 2021 16:00
Save the following file in your project as `bin/post_compile` and after slug compilation it will be downloaded and a binary placed in a `vendor/ffmpeg` folder in your project root. Invoke FFMPEG as `/app/vendor/ffmpeg/ffmpeg -h`
#!/bin/bash
current=`pwd`
filename=ffmpeg.static.64bit.2013-08-15.tar.gz
url=http://ffmpeg.gusari.org/static/64bit/$filename
source $BIN_DIR/utils
puts-step "Installing FFMPEG"

Keybase proof

I hereby claim:

  • I am flashingpumpkin on github.
  • I am flashingpumpkin (https://keybase.io/flashingpumpkin) on keybase.
  • I have a public key ASD8DCAKeRz1X2bMXAYJ2Mn287fv_xWabyLkXKe04CCPXQo

To claim this, I am signing this object:

@flashingpumpkin
flashingpumpkin / ducky.md
Created January 10, 2020 14:36 — forked from schmich/ducky.md
Programming media keys on the Ducky One 2 Skyline

Programming Media Keys on the Ducky One 2 Skyline

To use media keys on the Ducky One 2 Skyline, you must record a macro to bind the media function to a hotkey combination, i.e. Fn plus some key.

Example

Important: In the instructions below, "Press X+Y+Z" means press and hold key X, press and hold key Y, press and hold key Z in that order, and then release all three.

As an example, to bind Fn+PgUp to the play/pause media function:

@flashingpumpkin
flashingpumpkin / ScalaJsElmExample.scala
Created November 14, 2018 16:54 — forked from Fristi/ScalaJsElmExample.scala
Monifu / Monix / Elm example
import japgolly.scalajs.react.vdom.all._
import japgolly.scalajs.react.{ReactElement, SyntheticEvent}
import monifu.reactive.Observable
import monifu.reactive.subjects.BehaviorSubject
object StateExample {
//---------------------------------
// (VIEW)-MODEL
//---------------------------------

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@flashingpumpkin
flashingpumpkin / coroutine.py
Created March 1, 2012 16:55
Decorator for coroutine usage.
def coroutine(func):
"""
A decorator that turns a function with normal input into a coroutine.
This decorator takes care of priming the coroutine, doing the looping and
handling the closing.
The first argument of any decorated function is what was received when
data was sent to the coroutine via the ``.send`` method. All the other
``*args`` and ``**kwargs`` are what was passed to the decorated function
when instantiating the coroutine.
@flashingpumpkin
flashingpumpkin / device.css
Created May 24, 2016 12:51 — forked from jsoverson/device.css
Quick css hacks to target android/ios
.visible-android {
display:none;
}
.visible-ios {
display:none;
}
.on-device .visible-android, .on-device .visible-android {
display:inherit;
}
.device-ios .visible-android {