Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
import UserValidations from 'twiddle/validations/user';
export default Ember.Controller.extend({
UserValidations,
actions: {
submit(model) {
console.log('submit', model)
model.save()
import Ember from 'ember';
import UserValidations from 'twiddle/validations/user';
export default Ember.Controller.extend({
UserValidations,
actions: {
submit(model) {
console.log('submit', model)
model.save()
@GCheung55
GCheung55 / .block
Created September 30, 2020 22:08 — forked from domoritz/.block
Vega Bl.ocks example
license: bsd-3-clause
<ol>
<li>Open browser dev tools</li>
<li>click "Make True"</li>
<li>click "Make False"</li>
<li>Notice an error in the console</li>
</ol>
<button {{on 'click' this.makeTrue}}>
Make True
</button>
//app/components/marcas/marcas-form.js
import Component from '@ember/component';
export default Component.extend({
//https://guides.emberjs.com/v3.3.0/components/triggering-changes-with-actions/
//https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/closure-actions.md
// Noop, needs to be overriden
onSave() {},
@GCheung55
GCheung55 / .block
Last active July 2, 2018 22:10 — forked from domoritz/.block
Vega-Lite Bl.ocks example
license: bsd-3-clause
@GCheung55
GCheung55 / _.js
Created December 27, 2012 22:44 — forked from anonymous/_.js
"use strict";
var prime = require('prime')
var ghost = require('prime/util/ghost')
var typeOf = require('prime/util/type')
var shells = {
"string" : require("prime/types/string"),
"number" : require("prime/types/number"),
"array" : require("prime/collection/list"),
@GCheung55
GCheung55 / Default (OSX).sublime-keymap
Created March 29, 2012 21:47 — forked from idan/Default (OSX).sublime-keymap
Sublime Text asymmetric layout - place files in Packages/User
[
{
"keys": ["super+alt+shift+5"],
"command": "set_layout",
"caption" : "1-2 Grid",
"args":
{
"cols": [0.0, 0.5, 1.0],
"rows": [0.0, 0.5, 1.0],
"cells":
@GCheung55
GCheung55 / bootstrap.js
Created March 22, 2012 21:59 — forked from sebmarkbage/bootstrap.js
Using link.js options
var loader = require('../path/to/link');
loader.alias('package', '../path/to/package.js');
loader.alias('package2', '../path/to/package2.js');
loader.base('../path/to/my/root/folder/');
loader.load('main');
@GCheung55
GCheung55 / apf_release.prepend.js
Created March 21, 2012 18:21 — forked from SchizoDuckie/apf_release.prepend.js
Cloud9 IDE Touch Enabler Monkeypatch
/**
* A proof of concept monkeypatch to make Cloud9 IDE work on a tablet.
* Since i'm an extremely lazy bastard I prepended this snippet directly in package/client/js/apf_release.js
*
* What does it do?
* - It fires a doubleclick for a 2-finger tap
* - It fires a mousewheel up / down event for a 2-finger swipe up / down.
*
* How does it work?
* Prepend the functions below to <cloud9>/package/client/js/apf_release.js, save, load in tablet.