Skip to content

Instantly share code, notes, and snippets.

Avatar

Stanislav Panferov s-panferov

View GitHub Profile
View col.ts
export interface ModelState<Model> {
model: opty.Option<Model>;
isProcessing: boolean;
isPending: boolean;
}
export interface ListModel<Ref, Model, Meta> {
models: immutable.Map<Ref, rx.BehaviorSubject<ModelState>>;
meta: opty.Option<Meta>;
}
View genericHell.ts
state = rx.BehaviorSubject<
model_state.ModelState<
immutable.Map<
Ref,
rx.BehaviorSubject<model_state.ModelState<Model, void>>
>,
Meta
>
>;
View with.js
var x = 5;
var y = 10;
with({x: 20}) {
var x = 30;
var y = 30;
console.log(x);
console.log(y);
};
View webpack.config.js
var webpack = require('webpack');
var path = require("path");
module.exports = {
entry: {
app: './src/app/app.ts',
vendor: [
"jquery",
"jquery-mockjax",
View dep-hell.js
modules.define('madison',
['log', 'config', 'utils', 'router', 'bank__auth', 'bank__customers', 'page'],
function(provide, log, config, utils, router, bankAuth, bankCustomers, page) {
var vow = require('vow'),
express = require('express'),
path = require('path'),
cookies = require('cookie-parser'),
session = require('express-session'),
body = require('body-parser');
View json.json
{
block : 'form-field',
name : 'documentUrgency',
mods : { theme : 'alfa', bkg : 'color' },
content : [
{ tag : 'br' },
{ tag : 'br' },
{ tag : 'br' },
{
block : 'checkbox',
@s-panferov
s-panferov / chat.ts
Created Jun 19, 2015
Immutable models in TS
View chat.ts
import invariant from '../lib/invariant';
import * as models from './index';
import { Record, Map, Set, List } from 'immutable';
import { Option, Some, None } from 'opty';
export enum ChatType {
Dialog = <any>'dialog',
Room = <any>'room'
}
View gist:c1ef473f811438d719bf
{
"version": "1.5.0-beta",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"jsx": "react",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
View gist:8a7e26350ddb31254269
var webpack = require('webpack');
var path = require("path");
var fs = require("fs");
var nodeModules = {};
fs.readdirSync('node_modules')
.filter(function (x) {
return ['.bin'].indexOf(x) === -1;
})
.forEach(function (mod) {