Skip to content

Instantly share code, notes, and snippets.

View koriroys's full-sized avatar
🐢
Slow and Steady

Kori Roys koriroys

🐢
Slow and Steady
View GitHub Profile
@koriroys
koriroys / class_methods.rb
Created April 13, 2020 16:45
Why does this happen?
class Thing
class << self
def public_method
private_method
end
private
def private_method
"hello"
end
@koriroys
koriroys / coffee-asset-pipeline-comments.js
Last active January 17, 2020 11:20
convert all coffeescript files to javascript
var fs = require('fs'),
os = require('os'),
lineReader = require('line-reader');
function help(){
console.log('Usage: node coffee-asset-pipeline-comments.js file1.coffee');
}
function compilefile(pathname, outdir){
var src = '';
@koriroys
koriroys / rspec_boolean_matcher.rb
Created May 13, 2014 19:03
rspec boolean matcher
require 'rspec/expectations'
RSpec::Matchers.define :be_boolean do
match do |actual|
[true, false].include? actual
end
failure_message_for_should do |actual|
"expected that #{actual.inspect} would be a boolean(true or false)"
end
@koriroys
koriroys / .gitconfig
Created April 20, 2012 02:30
pretty print for git log
[alias]
lg = log --graph --pretty=format:\"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\" --abbrev-commit --date=relative --max-count=50
@koriroys
koriroys / controllers.application.js
Last active January 19, 2017 13:37
Checkbox: <input> vs {{input}}
import Ember from 'ember';
export default Ember.Controller.extend({
isChecked: true,
isCheckedTwo: true,
isCheckedThree: true,
appName: 'Ember Twiddle',
actions: {
foo() {},
fooTwo() {
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
import Location from '../models/location';
import Grid from '../models/grid';
const { Component, get, set, computed, isEqual, isPresent } = Ember
export default Component.extend({
lastTapped: null,
init() {
@koriroys
koriroys / components.my-child.js
Last active July 5, 2016 09:47
Fun with DDAU
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super(...arguments);
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});

Integrating TinyMCE in an ember-cli app

TinyMCE is a javascript WYSIWYG editor that is highly configurable and has a ton of features and plugins. It integrates with jQuery and, with a bit of work, it can be integrated in your ember-cli app.

Step 1: Install TinyMCE:

bower install --save tinymce

Step 2: Import the required files into your app via broccoli. In order to do that you will need a plugin called broccoli-static-compiler: