Skip to content

Instantly share code, notes, and snippets.

View SlexAxton's full-sized avatar

Alex Sexton SlexAxton

View GitHub Profile
[19:57:23] SlexAxton: I have a dream about a url middleware/prefilter thing, and wanted feedback on the feasibility.
[19:57:51] SlexAxton: There are sometimes when I'd prefer a url to be displayed differently than ember likes to do it
[19:58:21] SlexAxton: One example in my app is kind of a global account setting
[19:58:25] SlexAxton: you can multiple accounts
[19:58:31] SlexAxton: and we want that reflected in the url
[19:58:45] SlexAxton: coolguy.com/myaccount1/foos
[19:58:50] SlexAxton: coolguy.com/myaccount1/bars
[19:59:13] SlexAxton: but really that should be a query param (foos and bars aren't 'under' the account)
[19:59:27] SlexAxton: coolguy.com/foos?account=myaccount1
[19:59:49] SlexAxton: I'd love to be able to create a map for my urls onto the url that works best with ember
@SlexAxton
SlexAxton / npm-debug.log
Created November 8, 2014 00:48
HOW DARE U
$ npm isntall
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/Users/alexsexton/.nave/installed/0.10.33/bin/npm" "isntall"
npm ERR! node v0.10.33
npm ERR! npm v2.1.7
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module '/Users/alexsexton/.nave/installed/0.10.33/lib/node_modules/npm/lib/isntall.js'
npm ERR!
npm ERR! If you need help, you may report this error at:
@SlexAxton
SlexAxton / 00_messagefile.mf.json
Last active August 29, 2015 14:08
msgpack requirejs plugin
{
"somekey" : {
"message" : "Submit",
"description" : "This is the label next to the button where the form is sent to the server."
},
"somekey2" : {
"message" : "Cancel",
"description" : "This is the text on the button that clears the form and sends you back to the page beforehand."
},
"excited_somekey" : {
/*jshint unused:false */
function test(a, b) {
var c, d = 2;
return a + d;
}
test(1, 2);
//fine

Before I watched this, if someone would have asked about why Pointer Events wasn't getting into Chrome, I'd have pointed at Safari. I don't love that reason, but it makes sense with their current dominance on mobile. However, I don't necessarily agree, I think if every other browser implemented them, they'd come around. That's tended to be true on the web for the last 20 years (Old IEs, webgl, innerHTML, video codecs when hardware is present, etc)

As far as the main issues brought up here, which I hopefully have fairly summarized (in one sentence each, lol, sry) below, I don't see them as entirely compelling for dropping PE altogether, especially since so many real-world folks (jQuery, Dojo, IE-y people) like the unification quite a bit.

  1. Hit tests (with or without capture) are expensive and bad for performance

From what I can read from the previous calls and conversations[0] about this, it's less of an issue than it seems. From those conversations, it seemed like hit tests weren't cached, and Chrome at

@SlexAxton
SlexAxton / emotibarstests.js
Created August 5, 2014 06:07
Test that I'm passing for my emotibars compiler.
var Emotibars = require('../src');
var should = require('should');
describe('Emotibars', function(){
describe('Basic API', function() {
it('should be a function itself', function() {
Emotibars.should.be.a.Function;
});
it('should have a parse function', function() {
@SlexAxton
SlexAxton / test.hbs
Last active August 29, 2015 14:04
nested components
{{! QUESTION
How do I make the outer component send an attribute value into its sub-components,
or have the sub-components read from the parent attributes?
In the following example, the `multiple="true"` attribute changes the toggle group
to act like a set of checkboxes instead of a set of radio buttons, but the semantics
are more like an html 'select' menu.
<select multiple>
# Add this to your .bashrc or .zshrc
tmosh () {
mosh "$1" -- tmux -2 attach -t 0 -d
}
@SlexAxton
SlexAxton / estmt1.4.7.js
Created April 1, 2014 18:05
An updated copy of American Expresses code on the recent activity page with some errors removed.
This file has been truncated, but you can view the full file.
/* jQuery v1.7.1 jquery.com | jquery.org/license */
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement){cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close()
}d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=

Keybase proof

I hereby claim:

  • I am slexaxton on github.
  • I am slexaxton (https://keybase.io/slexaxton) on keybase.
  • I have a public key whose fingerprint is 9D44 FE16 DDD6 80BC 06AD E471 13CE 42FD 3C33 F935

To claim this, I am signing this object: