Skip to content

Instantly share code, notes, and snippets.

Working on something exciting

Alexey Raspopov alexeyraspopov

Working on something exciting
View GitHub Profile
View timestamp.js
provider = typeof window === 'object' && window.performance || Date;
timestamp = typeof === 'function' ? : function(){ return +new Date(); };
View gist:eaffd30d5e8f65e739b2
function min(initial){
return map(function(value){
if(isNaN(initial) || value < initial){
initial = value;
return initial;
View gist:b93bd6bd0e9573dc9b5f
function SomeViewModel(title){
this.title = data(title)
this.description = event(node, 'change')
this.full = computed(interpolate('$0: $1'), [this.title, this.description]);
View gist:f796a055ee6251df472b
var data = require('./index');
function wrapper(process){
var observable, wrapper;
observable = data();
wrapper = function(value){
return arguments.length ? process(observable, value) : observable();
alexeyraspopov / birds.js
Last active Aug 29, 2015
Traits in JavaScript with CommonJS Modules
View birds.js
var rolesComposition = require('./trait');
function Duck(swimMessage, flyMessage){
this.swimMessage = swimMessage;
this.flyMessage = flyMessage;
Duck.prototype = rolesComposition(require('./swimming'), require('./flying'));
function Penguin(swimMessage){
View gist:50f1f81a7e1c5cf08167
Переход от CLI к GUI, на примере работы с гитом:
* усложняется работа за счет взаимодействия с мышью
* если использовать шорткаты вместо мыши, необходимо кроме знания команд знать и комбинации привязанные к ним. И в таком случае GUI является посредником опыта пользователя.
View generator
function* counter(start){
while (true) yield start++;
View range
function range(min, max, inc=1){
return Array.apply(null, Array(max - min + 1))
.map((_, index) => index + min)
.filter((_, index) => !(index % inc));
View spread.js
// returns a function which receive an array of values and apply they to `fn` as params
function spread(fn){
return fn.apply.bind(fn, null);
View use-over.js
var slice =;
function use(fn, fns){
return function(){
var args = slice(arguments);
return fn.apply(null,, index){
return fns[index](arg);