Skip to content

Instantly share code, notes, and snippets.

View bmx269's full-sized avatar
💾
3d Printed Save Icon

Trent Stromkins bmx269

💾
3d Printed Save Icon
View GitHub Profile
@bmx269
bmx269 / config-pages--weather-configuration--full.html.twig
Created May 16, 2020 21:59
Weather Config Pages Vue App in Paragraph
{# string wrapper is to prevent Twig processing the Vue vars #}
<div id="weatherForecast">
<div id="current-weather">
<div class="header">
<h4 class="underline-left">Current Conditions</h4>
<div class="temp-toggle">
<input type="radio" id="f-temp" value="F" v-model="tempF" class="toggle">
<label for="f-temp">ºF</label>
<input type="radio" id="c-temp" value="C" v-model="tempF" class="toggle">
<label for="c-temp">ºC</label>

How to use positionalParams in Angle Bracket invocation

A component with positionalParams always also has named versions of its parameters. For example, the liquid-if component from liquid-fire has this in its Javascript file:

positionalParams: ['predicate']

So these are equivalent:

@bmx269
bmx269 / components.my-component.js
Created December 6, 2017 23:44 — forked from jpadilla/components.my-component.js
Component Lifecycle Hooks
import Ember from 'ember';
export default Ember.Component.extend({
didInitAttrs(options) {
console.log('didInitAttrs', options);
},
didUpdateAttrs(options) {
console.log('didUpdateAttrs', options);
},
saveVote: task(function * () {
var queueVotes = this.get('voteItems').map(item => {
item.set('isSelected', false);
let itemId = item.get('id');
let itemTitle = item.get('title');
let itemImage = item.get('fieldImage.url');
let currentCampaign = this.get('campaign.id');
let newVote= this.store.createRecord('node--vote', {
title: itemTitle,
fieldItemid: itemId,
@bmx269
bmx269 / vote.js
Created July 6, 2017 03:49
Vote forEach
saveVote() {
var votePromises = [];
this.get('voteItems').forEach(item => {
item.set('isSelected', false);
let itemId = item.get('id');
let itemTitle = item.get('title');
let itemImage = item.get('fieldImage.url');
let currentCampaign = this.get('campaign.id');
let newVote= this.store.createRecord('node--vote', {
title: itemTitle,

Status

This extension was developed as part of the jsonapi module for Drupal.

Introduction

The JSON API specification is agnostic about how a server implements filtering strategies. In fact, the spec says:

Note: JSON API is agnostic about the strategies supported by a server. The filter query parameter can be used as the basis for any number of filtering strategies.

@bmx269
bmx269 / app.js
Last active July 12, 2017 17:23 — forked from multpix/app_adapter.js
Ember adapter and serializer for Drupal 8 with JSON:API
// app/app.js
import Ember from 'ember';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
import './models/custom-inflector-rules'; // <-Add this line for the rules.
@bmx269
bmx269 / fixtures.js
Last active August 29, 2015 14:22
Servicebay Fixtures.js
if (Site.find().count() === 0) {
Site.insert({
domain: "localhost:3000",
featuresIntro: "<p>ServiceBay has many of the key features you will need to build a presence on the Internet, which is where your potential customers are looking for you. With setup and site configuration being handled, all you need to focus on is filling out your information, and choosing a design. We take you through all the steps with clear instructions, along with tips and tricks to make your website shine.</p>",
homeIntro: "<h2>ServiceBay is a website tool for the smaller mechanic shops, from backyard tinker's, to specialty automotive repair.</h2> \n<p>ServiceBay helps business owners promote their services, share a bit of their history, and share their passion for the vehicles they work on. Keeping it simple, and focussing on the needs of the business, all for a great price.</p>",
homeSplash: "http://servicebay.ca/img/home-splash.jpg",
siteTheme: "Master",
siteTitle: "ServiceBay - Easy Auto Service
@bmx269
bmx269 / getSite.js
Created April 22, 2014 22:40
Meteor get site from Headers
siteData = function(){
headers.ready(function() {
//console.log(headers.get());
});
var headersReady = headers.ready();
if (headersReady) {
var host = headers.get('host');
var host = String(host).replace(/^www\./,'');

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.