Skip to content

Instantly share code, notes, and snippets.

View dmitriid's full-sized avatar

Dmitrii 'Mamut' Dimandt dmitriid

View GitHub Profile
@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');
@dmitriid
dmitriid / putin.txt
Created September 29, 2015 07:09
putin answers
- Vladimir Vladimirovich, what is two times two?
- I'll be brief. You know, just the other day I was at the Russian Academy of Sciences
and had a discussion with many scientists there, including young scientists,
all of them very bright, by the way. As it happens, we touched upon the present problem,
discussed the current state of the country's economy; they also descibed their plans
for the future. Of course, the number one priority for them is the problem of relevancy;
also, just as important is the question of housing loans, but I can assure you that all
these problems can be solved and we will direct all our efforts to their resolution in
the nearest future.
Among other things this also applies to the subject you raised in your question.