I hereby claim:
- I am jsmesami on github.
- I am jsmesami (https://keybase.io/jsmesami) on keybase.
- I have a public key ASDf5JhKnt4_50WifeQ3SYoW27auqq114NuWFx3EMOxlUQo
To claim this, I am signing this object:
#!/usr/bin/env python | |
import os, time | |
import optparse | |
import subprocess | |
def watch(watchpath, delay=1): | |
"""\ | |
recursively iterates over files in a directory tree and watches for the ones that have been changed | |
returns an infinite iterator object containing filenames of changed files |
$.fn.slides = function(options) { | |
var opts = $.extend({}, $.fn.slides.defaults, options); | |
return this.each(function() { | |
var $container = $(this); | |
function switcher() { | |
$container.find('img').first().css(opts.CSShidden).detach() | |
.appendTo($container).animate(opts.CSSvisible, opts.duration, opts.easing); | |
} | |
setInterval(switcher, opts.interval); |
;; Function takes two numeric values, `from` and `to` you wish to animate. | |
;; First argument is a callback function, which is called each keyframe and the current value is passed to it. | |
;; There are also optional keyword arguments you can use to alter duration and number of keyframes of the animation. | |
;; The `then` callback can be used after the animation finishes for cleanup etc. | |
(defn animate | |
([callback from to & {:keys [duration keyframes then] | |
:or {duration 1000 | |
keyframes 30}}] | |
(let [distance (js/Math.abs (- to from)) |
(ns net.json-xhr | |
(:require | |
[ajax.core :as ajax] | |
[day8.re-frame.http-fx] | |
[re-frame.core :refer [reg-event-fx trim-v]] | |
(defn default-success-fx | |
[db response] | |
{:db db}) ;; You can define some useful default effects here |
I hereby claim:
To claim this, I am signing this object:
Run-length encode a sequence
Run-length encoding is a way to represent a sequence in a more compact form. Instead of saying :p :p :p, you say “3 :ps”. Write a function that takes a sequence and returns that sequence with run-length encoding.
For example:
(rle [:a :a :a :b :c :d :d :d :d])
;=> ([3 :a] [1 :b] [1 :c] [4 :d])
#!/usr/bin/env bash | |
LOCAL_BIN_DIR=~/.local/bin | |
BABASHKA_INSTALL=install | |
KONDO_INSTALL=install-clj-kondo | |
LSP_ARCHIVE=clojure-lsp-native-linux-amd64.zip | |
LSP_BIN=clojure-lsp | |
wget https://raw.githubusercontent.com/babashka/babashka/master/${BABASHKA_INSTALL}\ | |
&& chmod +x ${BABASHKA_INSTALL}\ |