Use vim and chrome developer tools as REPl environment. Press Ctrl-C Ctrl-C to eval code right in chrome console.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
type ParseContext = {string: string; position: number;}; | |
type Error = {reason: string; position: number}; | |
type Result<T> = {value: ?T; error: ?Error}; | |
type Parser<T> = (c:ParseContext) => [ParseContext, Result<T>]; | |
function then<T,U>(p: Parser<T>, f: (t: T) => Parser<U>): Parser<U>{ | |
return function(cxt){ | |
var [newCxt, result] = p(cxt); | |
if(result.value != null){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE NoMonomorphismRestriction #-} | |
import Text.ParserCombinators.Parsec | |
empty = many (oneOf "\t\n\r ") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nnoremap <C-c><C-C> :wa\|call system("tmux send-keys -t right ./build C-m")<CR> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
// http://flowtype.org/ | |
class DumbPromise<T>{ | |
value: T; | |
constructor(value:T){ | |
this.value = value; | |
}; | |
then<Y>(f:(x:T)=>Y): DumbPromise<Y> { | |
return new DumbPromise(f(this.value)); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop table if exists genre cascade; | |
drop table if exists song cascade; | |
drop table if exists users cascade; | |
drop table if exists listened_song cascade; | |
create table genre( | |
id serial primary key, | |
name text not null | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
coffeelint=./node_modules/coffeelint/bin/coffeelint -f coffeelint.json | |
coffee=./node_modules/coffee-script/bin/coffee | |
handlebars=./node_modules/handlebars/bin/handlebars | |
COFFEE=$(shell find app -type f -name '*.coffee') | |
JS=$(patsubst app/%.coffee, public/js/%.js, $(COFFEE)) | |
SCSS=$(shell find stylesheets -type f -name '*.scss') | |
CSS=$(patsubst stylesheets/%.scss, public/css/%.css, $(SCSS)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Тестовое задание: Frontend Web Developer | |
Надо реализовать веб-страницу для просмотра картинок из Flickr Public Feed. | |
Программный интерфейс Flick Public Feed описан тут: | |
https://www.flickr.com/services/feeds/docs/photos_public | |
Страница представляет из себя список фотографий с датой создания, названием и | |
списком тегов. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env rdmd | |
// implementation of this function http://underscorejs.org/#debounce | |
// in D programming language (http://dlang.org) | |
import std.stdio; | |
import std.datetime; | |
void test(double a){ | |
writeln("Invoked debounced func with ", a); |