Skip to content

Instantly share code, notes, and snippets.

View geekygrappler's full-sized avatar

Andy Brown geekygrappler

View GitHub Profile
@geekygrappler
geekygrappler / components.my-component.js
Created November 2, 2021 15:21 — forked from feanor07/components.my-component.js
stackoverflow question#43090234
import Ember from 'ember';
export default Ember.Component.extend({
isBlankSelected: Ember.computed.empty('selectedOption'),
actions: {
loadFilter(selectedOption) {
this.set('selectedOption', selectedOption);
}
}

After Review

The Problem

I realised the issue with the 4x4 grid is that it will miss bacteria that should die from overcrowding. For example:

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@geekygrappler
geekygrappler / bulkUpdatePickupDate.js
Created June 21, 2017 13:35
Google sheets script
function updatePickupDate() {
var sheet = SpreadsheetApp.getActive().getSheetByName('pickupDateAlterations');
var data = sheet.getDataRange().getValues();
var ordersAndPickupDates = getOrdersAndPickupDates(data);
Logger.log(ordersAndPickupDates);
var options = {
method: "patch",
payload: JSON.stringify({"orders": ordersAndPickupDates})
}
UrlFetchApp.fetch('https://citypantry.localtunnel.me/orders/bulk-update-pickup-date', options);
@geekygrappler
geekygrappler / promos.rb
Created June 12, 2017 22:27
Pseudo code
## Promocode controller/generate endpoint controller
def generate
begin
@promocode.is_valid?
rescue e #An array of errors
render json: e
end
if @promocode.save
{{todo-list createTodo="createTodo" model=model}}
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
return this.store.find('todo');
},
actions: {
createTodo: function (newTitle) {
// Create the new Todo model
var todo = this.store.createRecord('todo', {
{{todo-list createTodo="createTodo"}}
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
createTodo: function(newTitle) {
this.set('newTitle', '');
this.sendAction('createTodo', newTitle);
}
}
});
{{todo-list}}