Skip to content

Instantly share code, notes, and snippets.

View josiahhaswell's full-sized avatar

Josiah Haswell josiahhaswell

  • https://sunshower.io
  • Ft. Collins
View GitHub Profile
func (o *ContentAddOperation) add(fs files.File) (*AddedContent, error) {
var contentType ContentType
if fs.IsDirectory() {
contentType = Directory
for {
f, err := fs.NextFile()
if err == io.EOF {
break
} else if err != nil {
return nil, err
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: [
"<rootdir>/src"
],
transform: {
"^.+\.tsx?$": "ts-jest"
},
moduleFileExtensions: [
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"declaration": true,
"rootDir": "src",
"baseUrl": "./",
"typeRoots": [
"node_modules/@types",
<template>
<h1>${label}</h1>
</template>
@customElement('hello')
export class HelloElement {
@bindable label: string;
}
let component: any;
function initialize(bindingContext:any) {
let template = `
<hello label.bind="label"></hello>
`
component = StageComponent.withResources(PLATFORM.moduleName('hello'))
import 'reflect-metadata';
import 'aurelia-polyfills';
import { Options } from 'aurelia-loader-nodejs';
import { globalize } from 'aurelia-pal-nodejs';
import 'isomorphic-fetch';
import * as path from 'path';
require('jsdom-global')();
require('mutationobserver-shim');
import * as pug from 'pug';
import {PLATFORM} from 'aurelia-pal';
import {
StageComponent,
ComponentTester
} from 'aurelia-testing';
export function render(template: string, options?:any) : string {
return pug.compile(template.trim())(options);
{
"objective": "minimize",
"name": "stigler diet",
"type": "io.sunshower.anvil.model.LinearOptimizationProblem",
"variables": {
"constraint": [
{
"name": "Calories (1000s)",
"coefficient": 3.0
},
@Getter
@Setter
@XmlRootElement
public class LinearSolution extends AbstractElement<LinearSolution> {
@XmlAttribute(name = "solution-type")
private SolutionType solutionType;
@XmlElement(name = "statistic")
@XmlElementWrapper(name = "statistics")