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 Component from '@glimmer/component'; | |
import { tracked } from '@glimmer/tracking'; | |
import { action } from '@ember/object'; | |
import scale from 'ember-animated/motions/scale'; | |
import resize from 'ember-animated/motions/resize'; | |
import fade from 'ember-animated/transitions/fade'; | |
export default class Task extends Component { | |
@tracked |
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 LSAdapter from 'ember-localstorage-adapter'; | |
export default LSAdapter.extend({ | |
namespace: 'twiddleApp' | |
}); |
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
function setupExportBtn () { | |
const exportBtn = '<button id="export-btn">Download pdf</button>' | |
$('div.leaflet-control-layers').append(exportBtn) | |
// create hidden link for downloading export pdf | |
const hiddenLink = document.createElement('a') | |
hiddenLink.setAttribute('download', 'download.pdf') | |
hiddenLink.style = 'display:none;' | |
hiddenLink.target = '_blank' | |
document.body.append(hiddenLink) | |
$('#export-btn').on('click', (e) => { |
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 {Component, ChangeDetectorRef} from '@angular/core'; | |
import {MdSnackBar} from '@angular/material'; | |
declare const firebase: any; // declare the firebase global variable so Typescipt doesn't complain | |
@Component({ | |
selector: 'app-root', | |
template: ` | |
<button *ngIf="test" (click)="failedAttempt()">Click me</button> | |
`, | |
styleUrls: ['./app.component.css'] |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
stateArrays: [[1, "Alabama"], [2, "Alaska"], [3, "Arizona"]] | |
}); |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
rows: [ | |
{name: 'bob', value: "24"}, | |
{name: 'peter', value: "32"} | |
], | |
checkValue: Ember.observer('[email protected]', function () { | |
const unique = Ember.get(this, 'rows').uniqBy('value') |
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 FormObject = Ember.Object.extend({ | |
toJSON() { | |
// get a pure POJO | |
const tempObj = JSON.parse(JSON.stringify(this)) | |
tempObj.isDirty.delete | |
return tempObj | |
}, | |
isDirty: false, | |
set(key, value) { | |
this._super(...arguments) |
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 path = require('path') | |
module.exports = function (server) { | |
const publicPath = path.resolve(__dirname, '..', 'public') | |
server.use('/public', server.loopback.static(publicPath)) | |
const clientPath = path.resolve(__dirname, '..', '..', 'client', 'dist') | |
server.use('/assets', server.loopback.static(path.resolve(clientPath, 'assets'))) | |
server.use('/fonts', server.loopback.static(path.resolve(clientPath, 'fonts'))) | |
server.get('/robots.txt', (req, res) => { |
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 basicAuthParser = require('basic-auth') | |
var basicAuth = function (req, res, next) { | |
const user = basicAuthParser(req) | |
const validUser = user && | |
user.name === process.env.BASIC_AUTH_USER && | |
user.pass === process.env.BASIC_AUTH_PASS | |
if (!validUser) { | |
res.set('WWW-Authenticate', 'Basic realm=Authorization Required') |
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
// Add ability to paste images inline in html wysiwyg editor | |
// from https://github.com/keystonejs/keystone/issues/1545 | |
keystone.init({ | |
... | |
'wysiwyg additional plugins': 'paste', | |
'wysiwyg additional options': { | |
'paste_data_images': true | |
} | |
... | |
}); |
NewerOlder