Skip to content

Instantly share code, notes, and snippets.

View ember-source-1.11.3.diff
This file has been truncated, but you can view the full file.
--- gem.js 2015-04-24 11:35:45.000000000 +0900
+++ web.js 2015-04-24 11:36:43.000000000 +0900
@@ -1107,7 +1107,7 @@
*/
Ember.MODEL_FACTORY_INJECTIONS = false;
- if (Ember.ENV && typeof Ember.ENV.MODEL_FACTORY_INJECTIONS !== "undefined") {
+ if (Ember.ENV && typeof Ember.ENV.MODEL_FACTORY_INJECTIONS !== 'undefined') {
Ember.MODEL_FACTORY_INJECTIONS = !!Ember.ENV.MODEL_FACTORY_INJECTIONS;
@tricknotes
tricknotes / dest-2.js
Last active Aug 29, 2015
$ 6to5 source.js -m amd
View dest-2.js
// 6to5 source.js -m umd
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "module"], factory);
} else if (typeof exports !== "undefined" && typeof module !== "undefined") {
factory(exports, module);
}
})(function (exports, module) {
"use strict";
View application-80f872aa6889771df05f558a5f1ccde801ccfe7552f653af8f6a8b8e11e2fbcc.js
Ember.TEMPLATES["application"] = Ember.HTMLBars.template((function() {
return {
isHTMLBars: true,
cachedFragment: null,
build: function build(dom) {
var el0 = dom.createDocumentFragment();
var el1 = dom.createElement("div");
dom.setAttribute(el1,"class","topbar");
var el2 = dom.createTextNode("\n ");
dom.appendChild(el1, el2);
View selection.js
document.addEventListener('mouseup', function() {
var text = window.getSelection().toString();
console.log(text);
});
@tricknotes
tricknotes / 0_reuse_code.js
Created Jan 20, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View ember-demo.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://builds.emberjs.com/handlebars-1.0.0.js"></script>
<script src="http://builds.emberjs.com/tags/v1.0.0/ember.js"></script>
</head>
<script type="text/x-handlebars">
View Gemfile
source 'https://rubygems.org'
gem 'activerecord', '4.0.0.beta1', require: 'active_record'
gem 'enumerize', github: 'brainspec/enumerize'
gem 'sqlite3'
View benchmark.js
var https = require('https');
var tls = require('tls');
var i, now, count = 10000000;
var port = 10443, host = 'localhost', options = {};
var agent = new https.Agent();
// stub function
tls.connect = function() {};
now = Date.now();
View benchmark.js
var Readable = require('stream').Readable;
var i, now, count = 1000000;
var source = Readable.toString().split('\n')[9];
now = Date.now();
for (i = 0; i < count; i++) {
new Readable();
}
View benchmark.js
var domain = require('domain');
var i, now, count = 10000000;
var source = domain.Domain.toString();
now = Date.now();
for (i = 0; i < count; i++) {
domain.create();
}