Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init: function () {
this._super();
Ember.run.schedule("afterRender",this,function() {
this.send("later");
});
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '',
markup: Ember.computed('state',function(){
return `<div><strong>${this.get('state')}</strong><div><!--morph:yield--></div></div>`;
}),
});
@rohmann
rohmann / custom-nav-walker.php
Last active December 12, 2016 23:15
WordPress Custom Nav walker as a template
<?php
/*
I've not tested it, but this is the result of thinking through how one might output custom navigation menu markup using a theme template file.
1. Include this class
2. Call a menu in one of your templates, and reference a template using the new arguments available. For example
wp_nav_menu( array(
@rohmann
rohmann / discourse-secure-note.rb
Last active June 13, 2017 22:25
Discourse Secure Note
# name: discourse-secure-note
# about: Allow the attachment of secure notes to posts that are visible to staff and the post owner.
# version: 0.1
# authors: Alexander Rohmann
# url:
PLUGIN_NAME ||= "discourse_secure-note".freeze
after_initialize do
ul.display-posts-listing {
list-style:none;
}
.excerpt-dash {
display:none;
}
.listing-item {
margin-bottom: 2.5em;
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'li',
});
@rohmann
rohmann / functions.php
Last active September 22, 2022 13:27
Pro / Cornerstone Custom Loopers Example
<?php
// NOTE: Unfortunately, this code no longer works because Google has shut down
// their V3 API for Sheets. We used that at the time because it didn't require
// additional setup, nor creating an API key unlike the V4 API.
// This is the new URL syntax, and it requires an API Key
// https://sheets.googleapis.com/v4/spreadsheets/SHEET_ID/values/NAME_OF_SHEET_TAB?alt=json&key=API_KEY
// It isn't compatible with the code below, so you sill still need to write custom PHP to reformat the JSON