Skip to content

Instantly share code, notes, and snippets.

@valichek
valichek / gist:ba510de9ff2cf3d0c502
Created May 5, 2014 21:12
Strange behaviour of merge and into with map where keys are instances of AsyncChannel from http-kit
(ns clj-test-server.core
(:use org.httpkit.server))
; https://github.com/http-kit/http-kit/blob/master/src/java/org/httpkit/server/AsyncChannel.java
(def clients (atom nil))
(defn handler []
(future (let
[merged (merge {} @clients)]
@valichek
valichek / gist:6bff5ff0ff626aaea666
Last active November 4, 2021 20:35
Thread safe println #clojure #debug
;http://yellerapp.com/posts/2014-12-11-14-race-condition-in-clojure-println.html
(defn safe-println [& more]
(.write *out* (str (clojure.string/join " " more) "\n")))
@valichek
valichek / bundle.js
Created May 28, 2015 11:43
jspm bundle task for gulp
var gulp = require('gulp');
var paths = require('../paths');
var jspm = require('jspm/api');
gulp.task('bundle', function (done) {
jspm.bundle(
[
'*',
'aurelia-skeleton-navigation/*',
'aurelia-bootstrapper',
@valichek
valichek / compiler.ts
Last active September 17, 2015 21:54 — forked from charlespockert/compiler.ts
Kendo grid with Aurelia
import {inject, ViewCompiler, ViewResources, Container} from 'aurelia-framework';
/**
* Compiler service
*
* compiles an HTML element with aurelia
*/
@inject(ViewCompiler, ViewResources, Container)
export class Compiler {
<template>
<ul class="nav nav-tabs">
<li role="presentation" click.delegate="$parent.selectTab(tab)" repeat.for="tab of tabs" class="${ $parent.selectedTab === tab ? 'active' : '' }"><a href="#">${ tab.heading }</a></li>
</ul>
<div style="margin-top:8px">
<content></content>
</div>
</template>
// Copyright 2015 Simon Schmidt
// Copyright 2012 Junqing Tan <ivan@mysqlab.net> and The Go Authors
// Use of this source code is governed by a BSD-style
// Part of source code is from Go fcgi package
// Fix bug: Can't recive more than 1 record untill FCGI_END_REQUEST 2012-09-15
// By: wofeiwo
package fcgiclient
@valichek
valichek / app.html
Last active March 1, 2017 22:06
Aurelia Skeleton list list-item implementation
<template>
<require from="./list"></require>
<div>List</div>
<list></list>
</template>
@valichek
valichek / main.js
Last active October 8, 2017 22:33
Aurelia Webpack basic config (jquery, bootstrap, i18n, validation)
var Promise = require('bluebird'); // Promise polyfill for IE11
// Bluebird config
Promise.config({
// Enable warnings
warnings: true,
// Enable long stack traces
longStackTraces: true,
// Enable cancellation
cancellation: false,
// Enable monitoring
@valichek
valichek / app.html
Last active May 4, 2016 14:25
Aurelia + i18n plugin with not valid config of namespaces, throws 404 for translation ns
<template>
<h1>${message}</h1>
<div>${'val' | t} ${'tr1:val1' | t}</div>
<button click.trigger="changeLocale('de')">de</button>
<button click.trigger="changeLocale('en')">en</button>
</template>
@valichek
valichek / app.html
Created May 4, 2016 14:25
Aurelia + i18n plugin with not valid config of namespaces, throws 404 for translation ns
<template>
<h1>${message}</h1>
<div>${'val' | t} ${'tr1:val1' | t}</div>
<button click.trigger="changeLocale('de')">de</button>
<button click.trigger="changeLocale('en')">en</button>
</template>