Skip to content

Instantly share code, notes, and snippets.

View GavinJoyce's full-sized avatar

Gavin Joyce GavinJoyce

View GitHub Profile
//http://www.javascriptkit.com/javatutors/requestanimationframe.shtml
//http://learncssgrid.com/
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
_scroll() {
let $el = document.getElementsByClassName('tracks-container')[0];
import Ember from 'ember';
export default Ember.Component.extend({
});
@GavinJoyce
GavinJoyce / components.x-details.js
Last active August 29, 2017 13:49
Simple Contextual Components
import Ember from 'ember';
export default Ember.Component.extend({
tagName: ''
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
let options = [
"111", "222", "333", "444", "555", "666", "777", "888", "999", "000",
"111", "222", "333", "444", "555", "666", "777", "888", "999", "000",
"111", "222", "333", "444", "555", "666", "777", "888", "999", "000",
"111", "222", "333", "444", "555", "666", "777", "888", "999", "000",
"111", "222", "333", "444", "555", "666", "777", "888", "999", "000",
"111", "222", "333", "444", "555", "666", "777", "888", "999", "000",
"111", "222", "333", "444", "555", "666", "777", "888", "999", "000",
import Ember from 'ember';
export default Ember.Component.extend({
name: 'Alex'
});
@GavinJoyce
GavinJoyce / youtube.rb
Created July 24, 2017 08:36
Simple YouTube subscriber and view count script for MacBook Pro Touch Bar (see https://www.youtube.com/watch?v=gsRTtO-8ofM)
#!/usr/bin/env ruby
# See https://www.youtube.com/watch?v=gsRTtO-8ofM for details on how to use this
require 'net/http'
require 'json'
CHANNEL_ID = '<CHANNEL_ID_HERE>'
API_KEY = '<YOUTUBE_API_KEY_HERE>'
YOUTUBE_URL = "https://www.googleapis.com/youtube/v3/channels?part=statistics&id=#{CHANNEL_ID}&key=#{API_KEY}"
@GavinJoyce
GavinJoyce / first-time-ember-contributors.md
Last active July 18, 2017 10:35
Useful Links for first time Ember.js contributors
@GavinJoyce
GavinJoyce / components.my-component.js
Last active July 15, 2017 18:49
_debugContainerKey
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super();
this.set('containerKey', this._debugContainerKey);
}
});
# ember-cli-detergent
Ember linting tools such as [`ember-cli-eslint`](https://github.com/ember-cli/ember-cli-eslint) are a great way of enforcing coding standards and preventing bad practices from entering your Ember applications. The rules that they enforce are all or nothing, if your app already contains these bad practices you are forced to either remove all occurrences before enabling the rule, or simply not use the rule.
`ember-cli-detergent` allows you to specify rules and an allowed count of rule failures, eg:
```js
methods: {
'htmlSafe': {
allowedCount: 5,