Skip to content

Instantly share code, notes, and snippets.

View coderberry's full-sized avatar

Eric Berry coderberry

View GitHub Profile
cannedServer = (fakeServerDir) ->
canPort = 3000
can = canned(fakeServerDir, { cors: true, logger: process.stdout })
http.createServer(can).listen(canPort)
console.log 'Canned listening at port ' + canPort
task 'server', 'start the brunch server in development', (options) ->
# ...
cannedServer 'cans'
http = require 'http'
https = require 'https'
fs = require 'fs'
path = require 'path'
{spawn, exec} = require 'child_process'
semver = require 'semver'
AdmZip = require('adm-zip')
GitHubApi = require 'github'
canned = require 'canned'
color codeschool
set guifont=Source\ Code\ Pro\ Light:h14
let g:NERDTreeWinPos = "right"
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
autocmd User Rails let b:surround_{char2nr('-')} = "<% \r %>" " displays <% %> correctly
:set cpoptions+=$ " puts a $ marker for the end of words/lines in cw/c$ commands
// Update LinkView to allow data attributes
Em.LinkView.reopen({
init: function() {
this._super();
var self = this;
Em.keys(this).forEach(function(key) {
if (key.substr(0, 5) === 'data-') {
self.get('attributeBindings').pushObject(key);
}
});
@coderberry
coderberry / Ember Meetup Topics
Last active August 29, 2015 13:56
Topic ideas for Ember SLC Meetup
March 2014
Promises/RSVP - Dan
Ember + Bootstrap Components - Brett/Mark
Lightening Round? - Anyone
Future
Containers
Computed Macros (custom)
Ember.Test.registerAsyncHelper('submitForm',
function(app, selector, context) {
var $el = findWithAssert(selector, context);
Ember.run(function() {
$el.submit();
});
}
);
// Example Usage
import Search from 'appkit/libs/search';
module('Unit: lib/search', {
setup: function() {},
teardown: function() {}
});
test('ajaxData', function() {
var search = Search.create();
var ad = search.get('ajaxData');
document.write('<div id="ember-testing-container"><div id="ember-testing"></div></div>');
Ember.testing = true;
window.startApp = require('appkit/tests/helpers/start-app')['default'];
window.isolatedContainer = require('appkit/tests/helpers/isolated-container')['default'];
window.fakeServer = require('appkit/tests/helpers/fake-server')['default'];
function exists(selector) {
return !!find(selector).length;
var EmbedBtnDropdownComponent = Ember.Component.extend({
classNames: 'return-types',
actions: {
embedItem: function(returnType) {
this.sendAction('embedItem', returnType);
}
}
});