Skip to content

Instantly share code, notes, and snippets.

View Panman82's full-sized avatar

Ryan Panning Panman82

View GitHub Profile
@Panman82
Panman82 / coalesce.js
Last active May 13, 2020 10:44
Ember.js Coalesce Template Helper
import { helper } from '@ember/component/helper';
export function coalesce(...args) {
return args.find(arg => arg !== null && arg !== undefined);
}
export default helper(params => coalesce(...params));
@Panman82
Panman82 / .travis.yml.diff
Last active May 8, 2019 14:09
diff my-classic-addon my-octane-addon
--- a/my-classic-addon/.travis.yml
+++ b/my-octane-addon/.travis.yml
@@ -19,37 +19,20 @@ env:
global:
# See https://git.io/vdao3 for details.
- JOBS=1
-
-branches:
- only:
- - master
@Panman82
Panman82 / jwt.cfc
Last active September 16, 2021 15:14
ColdFusion component which has functions to work with JSON Web Tokens.
component
displayName = "JSON Web Token"
hint = "Utility library to work with JSON Web Tokens."
{
// Supported algorithms
variables.algorithms = {
"HS256" = "HmacSHA256",
"HS384" = "HmacSHA384",
@Panman82
Panman82 / components.deprecation-item.js
Created January 3, 2017 21:34
Register Child Components for Communication
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'li',
isExpanded: true,
registerItem: 'registerItem',
init(){
this._super( ...arguments );
this.sendAction('registerItem', this);
},
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@Panman82
Panman82 / controllers.application.js
Last active October 14, 2016 16:08
Using helpers in an attribute
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
filename: 'some.pdf'
});
@Panman82
Panman82 / components.my-button.js
Last active July 27, 2017 17:03
Closure action target option and context
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'button'
});
@Panman82
Panman82 / controllers.application.js
Last active October 4, 2016 19:28
Block params named component bug
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
components: ['foo','bar','baz']
});
@Panman82
Panman82 / ui-calendar.hbs
Created August 16, 2016 15:18
Semantic UI Ember Calendar Component
{{!-- app/templates/components/ui-calendar.hbs --}}
<div class="ui input {{if icon 'left icon'}}">
<i class="{{icon}} icon"></i>
<input type="text" placeholder="{{placeholder}}" />
</div>
@Panman82
Panman82 / linkto-inactive-class.js
Last active August 11, 2016 16:26
Add an `inactiveClass` to Ember `{{link-to}}`'s
// app/initializers/linkto-inactive-class.js
import Ember from 'ember';
export function initialize() {
Ember.LinkComponent.reopen({
classNameBindings : ['inactive'],
inactiveClass : false, // must implicitly set
inactive : Ember.computed('active', function(){
// Note: `activeClass` MUST return something truthy for this to work