Skip to content

Instantly share code, notes, and snippets.

<template>
<div>value transformed from 1 -> 2 -> 3 when input focused and button clicked</div>
<input blur.trigger="onBlur() & debounce:100" focus.trigger="onFocus() & debounce:100" />
<button click.delegate="clickHandler()" style="width: 50px">${value}</button>
</template>
@valichek
valichek / gist:bf55a3a7e70e56dd01aeb32abcf3b1e7
Created July 20, 2016 12:17 — forked from excavador/gist:a5a02dadf70573dd4981cab7cc3e3f33
запрос к PostgreSQL, который для указанных табличек сообщит все foreign keys
select
pg_namespace_parent.nspname as parent_schema, pg_class_parent.relname as parent_table, pg_attribute_parent.attname as parent_column,
pg_namespace_child.nspname as child_schema, pg_class_child.relname as child_table, pg_attribute_child.attname as child_column
from
(
select
pg_constraint.conrelid as "parent_table_id",
unnest(pg_constraint.conkey) as "parent_column_id",
pg_constraint.confrelid as "child_table_id",
unnest(pg_constraint.confkey) as "child_column_id"
@valichek
valichek / app.html
Last active June 15, 2016 13:14 — forked from jdanyow/app.html
Default slot content is not rendered when content of component is empty issue
<template>
<require from="./custom"></require>
<h2>Example 1: (rendered)</h2>
<custom>
<div slot="first">
<p>First slot</p>
</div>
</custom>
// 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
<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>
@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 {