Skip to content

Instantly share code, notes, and snippets.

View willrax's full-sized avatar
👨‍💻

Will Raxworthy willrax

👨‍💻
View GitHub Profile
import Ember from 'ember';
const { computed } = Ember;
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
value: 'test',
inputIsValid: computed('value', function() {
return this.get('value').includes('will');
})
@willrax
willrax / modules.md
Created December 8, 2017 09:35
Ember modules with single quotes
Before After
Ember.$ import $ from 'jquery'
Ember.A import { A } from '@ember/array'
Ember.Application import Application from '@ember/application'
Ember.Array import EmberArray from '@ember/array'
Ember.ArrayProxy import ArrayProxy from '@ember/array/proxy'
Ember.AutoLocation import AutoLocation from '@ember/routing/auto-location'
Ember.Checkbox `import Checkbox from '@ember/
defmodule AlphabotWeb.IntercomController do
use AlphabotWeb, :controller
def new(conn, %{"topic" => "conversation.user.created"} = params) do
%{payload: params["data"]["item"]}
|> send_notification
json conn, %{}
end
def new(conn, _params), do: json conn, %{}
import Ember from 'ember';
export default Ember.Component.extend({
exampleOne: Ember.computed(function() {
console.log(this);
return this;
}),
exampleTwo: Ember.computed(() => {
console.log(this);
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'li',
item: null
});
@willrax
willrax / components.my-component.js
Last active December 15, 2022 05:45 — forked from farisj/components.my-component.js
Indeterminate/Checked Inputs in Ember
import Ember from 'ember';
import _ from "lodash";
const { computed, get, set, isEqual } = Ember;
export default Ember.Component.extend({
items: [],
selectedItems: [],
allItems: computed.alias('items'),
import Ember from 'ember';
import { task } from 'ember-concurrency';
const { get, set } = Ember;
export default Ember.Component.extend({
tagName: '',
loadingComponent: null,
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
#!/bin/sh
# Base16 Eighties - Shell color setup script
# Chris Kempson (http://chriskempson.com)
if [ "${TERM%%-*}" = 'linux' ]; then
# This script doesn't support linux console (use 'vconsole' template instead)
return 2>/dev/null || exit 0
fi
color00="2d/2d/2d" # Base 00 - Black
@willrax
willrax / controllers.application.js
Last active September 20, 2017 13:37 — 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({