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
use std::net::{TcpListener, SocketAddr, TcpStream, Shutdown, SocketAddrV4, Ipv4Addr}; | |
use std::str::FromStr; | |
use std::thread::{spawn, JoinHandle}; | |
use std::io::{BufReader, BufWriter, Read, Write}; | |
fn pipe(incoming: &mut TcpStream, outgoing: &mut TcpStream) -> Result<(), String> { | |
let mut buffer = [0; 1024]; | |
loop { | |
match incoming.read(&mut buffer) { | |
Ok(bytes_read) => { |
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
<template> | |
<h1>Children selected: ${allSelected}</h1> | |
<button click.delegate="add98Children()">Add 98 children</button> | |
<button click.delegate="add1Children()">Add 1 children</button> | |
<ul> | |
<li repeat.for="child of children"> | |
${child.id} <input type="checkbox" checked.bind="child.selected" /> | |
</li> | |
</ul> | |
</template> |
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
@connectable() | |
@subscriberCollection() | |
export class DeepExpressionObserver { | |
constructor(scope, expression, observerLocator: ObserverLocator, lookupFunctions) { | |
this.scope = scope; | |
this.expression = expression; | |
this.observerLocator = observerLocator; | |
this.lookupFunctions = lookupFunctions; | |
} |
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
import {Parser, Expression, ComputedExpression, Binding, Scope, createOverrideContext} from 'aurelia-binding'; | |
class ComputedListExpression extends Expression { | |
/** | |
* @param {String} expressionStr Expression string for one dependency | |
*/ | |
constructor(expressionStr: string) { | |
super(); | |
const parser = new Parser(); |
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
<template> | |
<require from="./children"></require> | |
<p>Below are groups which get's re-rendered every time you add a child or re-name one. You can see it because of the logged getter calls.</p> | |
<div repeat.for="group of groupedChildren"> | |
<h3>${group.title}</h3> | |
<div repeat.for="child of group.children"> | |
<children child.bind="child"></children> | |
</div> | |
</div> | |
<br/> |
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
<template> | |
<require from="./lookup"></require> | |
<h1>${message}</h1> | |
<div repeat.for="item of items"> | |
Index: $index | Id: ${item.id} | ${item.value & lookup:item.type} | |
</div> | |
<button click.delegate="addItem()">Add item ${items.length}</button> | |
</template> |
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
const INTERPOLATION_START = '\\${'; | |
const INTERPOLATION_END = '}'; | |
const INTERPOLATION_EXPRESSION = new RegExp(`(${INTERPOLATION_START}(.*?)${INTERPOLATION_END})`, 'g'); | |
class TemplateEngine { | |
constructor(template) { | |
this.baseTemplate = template; | |
} |
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
import {HttpClientMock} from 'test/unit/mocks/http/http-client-mock'; | |
import {reportUnfulfilled, reportUnexpected} from 'test/unit/mocks/http/mock-helper'; | |
import {SomeViewModel} from 'app/view/some-view'; | |
describe('A ViewModel', function() { | |
/** @type Element */ | |
let host; | |
/** @type HttpClientMock */ | |
let http; | |
/** @type SomeViewModel */ |
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
import {HttpClient} from 'aurelia-http-client'; | |
import {Container} from 'aurelia-dependency-injection'; | |
import {Rest} from 'app/util/rest'; | |
import {Page} from 'app/model/page'; | |
export class AbstractModel { | |
/** | |
* @type {Array<String>} list of excluded fields |
NewerOlder