Skip to content

Instantly share code, notes, and snippets.

@krisselden
krisselden / test_helpers.js
Created June 6, 2014 20:14
pretender helper for qunit-bdd
var pretender;
export function server(dsl) {
if (pretender) {
dsl.call(pretender);
return pretender;
}
pretender = new Pretender(dsl);
pretender.unhandledRequest = function (verb, path, request) {
fail("Pretender intercepted "+verb+" "+path+" but no handler was defined for this type of request");
throw new Error("Pretender intercepted "+verb+" "+path+" but no handler was defined for this type of request");
@sergejmueller
sergejmueller / ttf2woff2.md
Last active March 9, 2024 13:37
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
@Chaser324
Chaser324 / GitHub-Forking.md
Last active May 13, 2025 18:32
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

ember-cli test

testem.json

{
  "framework": "qunit",
  "cwd": "dist",
  "test_page": "tests/index.html",
}
# app/assets/javascripts/ember-app/templates/partials/_header.js.coffee
%nav.navbar.navbar-default.navbar-fixed-top
.container
.navbar-header
%btn.navbar-toggle{ data: { target: '.navbar-collapse', toggle: 'collapse' }, type: 'button' }
%span.sr-only Toggle Navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
= hb 'link-to "index" class="navbar-brand"' do
(function(global) {
var get = Ember.get, set = Ember.set, doc = document;
global.FastSelectComponent = Ember.Component.extend({
items: null,
valuePath: 'value',
labelPath: 'label',
value: null,
selected: null,
@machty
machty / document-title-router.js
Created January 14, 2014 05:12
document.title integration in ember
// Extend Ember.Route to add support for sensible
// document.title integration.
Ember.Route.reopen({
// `titleToken` can either be a static string or a function
// that accepts a model object and returns a string (or array
// of strings if there are multiple tokens).
titleToken: null,
@wycats
wycats / app.js
Last active August 2, 2024 09:53
App.Router.map(function() {
this.resource('post', { path: '/posts/:post_id' });
});
App.PostRoute = Ember.Route.extend({
model: function(params) {
return this.store.find('post', params.post_id);
}
});
// Install jquery-mockjax into vendor
// file: /app/index.html
<!-- @if tests=true -->
<link rel="stylesheet" href="/vendor/qunit/qunit/qunit.css">
<script src="/vendor/qunit/qunit/qunit.js"></script>
<script src="/vendor/jquery-mockjax/jquery.mockjax.js"></script>
// And add it to karma.conf
// file: karma.conf.js
files = [