Skip to content

Instantly share code, notes, and snippets.

View allthesignals's full-sized avatar
🥑
coding lotsa code

Matt Gardner allthesignals

🥑
coding lotsa code
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ZoLa | NYC&rsquo;s Zoning &amp; Land Use Map</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<!-- Google tag (gtag.js) -->
=================================================================================
ENV Summary:
TIME: Thu Jun 30 2022 15:53:11 GMT-0500 (Central Daylight Time)
TITLE: ember
ARGV:
- /Users/mattgardner/.nvm/versions/node/v12.22.7/bin/node
- /Users/mattgardner/.nvm/versions/node/v12.22.7/bin/ember
- test
@allthesignals
allthesignals / error.log
Created June 29, 2022 01:48
Ember Error
=================================================================================
ENV Summary:
TIME: Tue Jun 28 2022 20:42:33 GMT-0500 (Central Daylight Time)
TITLE: ember
ARGV:
- /Users/mattgardner/.nvm/versions/node/v12.22.7/bin/node
- /Users/mattgardner/.nvm/versions/node/v12.22.7/bin/ember
- s
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
import {
validatePresence,
} from 'ember-changeset-validations/validators';
export default function validatePresenceIf(options) {
const { withValue, on } = options;
return (...args) => {
const [,,, changes, content] = args;
const hasMatchingWith = (changes[on] || content[on]) === withValue;
import buildMessage from 'ember-changeset-validations/utils/validation-errors';
import { validate } from 'ember-validators';
export default function validatePresence(options) {
let targets;
if (typeof options === 'boolean') {
options = { presence: options };
} else if (options && options.on !== undefined) {
if (typeof options.on === 'string') {
targets = [options.on];
@allthesignals
allthesignals / controllers.application.js
Last active May 10, 2020 06:23 — forked from poteto/controllers.application.js
ember-changeset-validations demo
import Ember from 'ember';
import AdultValidations from '../validations/adult';
import ChildValidations from '../validations/child';
import { reservedEmails } from '../validators/uniqueness';
import { schema } from '../models/user';
const { get } = Ember;
const { keys } = Object;
export default Ember.Controller.extend({

Goal

I'd like to mock the requests for tiles made by MapboxGL using Pretender.

Problem

Pretender doesn't intercept those requests

What I've discovered

@allthesignals
allthesignals / controllers.application.js
Last active December 23, 2019 17:24
Mapping with Ember MapboxGL
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.