This file contains 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 simplejson | |
import sqlalchemy | |
from sqlalchemy import String | |
from sqlalchemy.ext.mutable import Mutable | |
class JSONEncodedObj(sqlalchemy.types.TypeDecorator): | |
"""Represents an immutable structure as a json-encoded string.""" | |
impl = String |
This file contains 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
var template = '' + | |
'<div class="arrow"></div>' + | |
' <h3 class="popover-title">{{title}}</h3>' + | |
'<div class="popover-content">' + | |
'{{#if content}}' + | |
' {{content}}' + | |
'{{else}}' + | |
'{{yield}}' + | |
'{{/if}}' + | |
' </div>'; |
This file contains 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 Ember from 'ember'; | |
export default function(path, options) { | |
var buffer = "", | |
key; | |
var object = null; | |
var p = path.split('.'); | |
var keyword = p[0]; | |
var o = options.data.view.getStream(keyword).value(); |
This file contains 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
/** | |
A computed property that chains all given computed properties | |
Example | |
```javascript | |
Ember.computed.chain('content', [ | |
[Ember.computed.mapBy, 'key'], | |
[Ember.computed.filter, callback], //e.g. remove undefined/null | |
[Ember.computed.sum], | |
[customComputed] |
This file contains 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
var a_slice = [].slice; | |
Ember.ComputedProperty.prototype.chain = function(method){ | |
var chainedCP, dependentKey, args, func, cp = this; | |
dependentKey = Ember.guidFor(cp) + '-chain'; | |
args = [dependentKey].concat(a_slice.call(arguments,1)); | |
if (typeof method === 'string') { | |
method = Ember.computed[method]; | |
} |
This file contains 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 Resolver from 'ember-resolver'; | |
import { capitalize } from '@ember/string'; | |
import GlimmerComponent from '@glimmer/component'; | |
import EmberComponent from '@ember/component'; | |
/* | |
* Ember Tiny Module Unification Resolver | |
* this does not resolve local componentns and helpers, instead this should | |
* to be used together with ember-template-component-import and ember-template-helper-import | |
*/ |
This file contains 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 Controller from '@ember/controller'; | |
import { action } from '@ember/object'; | |
import { tracked } from '@glimmer/tracking'; | |
export default class ApplicationController extends Controller { | |
@tracked appName = 'Ember Twiddle'; | |
@tracked items = []; | |
This file contains 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
#expose components from addon to app | |
ls addon/components/**/component.* | xargs -I% sh -c 'p="%"; out=%;out=${out/addon/app};out=${out/.ts/.js};imp=${p/addon/ember-bscomponents};out=${out/components/components\/bs};imp=${imp/.ts/};imp=${imp/.js/};imp=\"$imp\"; mkdir | |
-p $(dirname $out) && echo "export { default } from $imp;" > $out' | |
#expose templates from addon to app | |
ls addon/components/**/template.* | xargs -I% sh -c 'p="%"; out=%;out=${out/addon/app};out=${out/.hbs/.js};imp=${p/addon/ember-bscomponents};out=${out/components/components\/bs};imp=${imp/.ts/};imp=${imp/.hbs/};imp=\"$imp\"; mkdi | |
r -p $(dirname $out) && echo "export { default } from $imp;" > $out' |
This file contains 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 Controller from "@ember/controller"; | |
import MyHelper from "../helpers/my-helper"; | |
export default class AppController extends Controller { | |
myHelper = MyHelper; | |
} |
This file contains 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
if (true) { | |
try { | |
const fs = require('fs'); | |
const nodePath = require('path'); | |
const memfs = require('memfs'); | |
const mem = memfs.fs; | |
// fs is missing vol.rmSync... | |
mem.rmSync = memfs.vol.rmSync.bind(memfs.vol); | |
const os = require('os'); |
OlderNewer