Skip to content

Instantly share code, notes, and snippets.

View dmitriid's full-sized avatar

Dmitrii 'Mamut' Dimandt dmitriid

View GitHub Profile
// @mariuslundgard
// The component
import {pluckSwitch} from './stream-helpers'
function main (sources) {
const sinks$ = NodeComponent({...sources})
// etc.
return {
DOM: pluckSwitch('DOM', sinks$),
@dmitriid
dmitriid / slax.md
Last active February 25, 2016 14:46
Auto screenshot uploader w/Elixir

Running

> ies -S mix
elixir> Slax.Monitor start

Source

##mix.exs

@dmitriid
dmitriid / api.ex
Created February 24, 2016 09:17
A bright and glorious vision of da future!
# Plugins
#
# Плагину достаточно выставить наружу command, принимающую context
#
# Где context — это
# %{ :scope => :jabber, # или там :slack или там :icq
# :from => ...,
# :to => ...,
# :room => ...
# }
///////////
// main.js
///////////
import Rx from 'rx';
import {h} from '@cycle/dom';
const main = (sources) => {
const HELLO_URL = 'https://something/api/v2/or-other/26';
const request$ = Rx.Observable.just(HELLO_URL);
@dmitriid
dmitriid / j.c
Last active January 15, 2016 09:46
A jtjgets(J jt,C*p){A y;B b;C*v;I j,k,m,n;UC*s;
*jt->adbreak=0;
if(b=1==*p)p=""; /* 1 means literal input */
if(jt->dcs){
++jt->dcs->dcn; j=jt->dcs->dci;
y=jt->dcs->dcy; n=AN(y); s=UAV(y);
RZ(j<n);
jt->dcs->dcj=k=j;
jt->dcs->dci=j=advl(j,n,s);
m=j-k; if(m&&32>s[k+m-1])--m; if(m&&32>s[k+m-1])--m;
$ brew outdated
caskroom/cask/brew-cask (0.54.1 < 0.60.1)
cask (0.7.2 < 0.7.4)
elixir (1.0.5, 1.1.1 < 1.2.0)
erlang (17.5, 18.1 < 18.2.1)
ffmpeg (2.6.2 < 2.8.4)
gettext (0.19.4, 0.19.6 < 0.19.7)
ghc (7.10.2 < 7.10.3b)
glib (2.44.0, 2.46.0 < 2.46.2)
gmp (6.0.0a < 6.1.0)
get_status_url_prop() ->
?FORALL( {Username, Lower}
, gen_username()
, <<"profiles/", Lower/binary ,"/data/status.json">> == util_content:get_status_url(Username)
).
gen_username() ->
?LET( Username
, list(char())
, begin

The answer: it should've been .merge in button's model, not .combineLatest. Obviously

Intended behaviour:

  • click the button
  • while the request is sent, display 'Loading...'
  • when the response is received, display original button
  • there are random color changes when the button is clicked (just to see that everything works)
-module(lc).

-export([lc/0]).

lc() ->
 [{X, Y} || X <- lists:seq(1, 5), Y <- lists:seq(1, 5), X rem 2 == 0, Y rem 2 == 1 ].

core:

/***
* Compile *.styl files to css.css:
* node build_css.js
*
* Watch *.styl files and compile them to css.css:
* node build_css.js -w
*/
var chokidar = require('chokidar');
var stylus = require('stylus');