Skip to content

Instantly share code, notes, and snippets.

View SlexAxton's full-sized avatar

Alex Sexton SlexAxton

View GitHub Profile

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:

@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=
# Add this to your .bashrc or .zshrc
tmosh () {
mosh "$1" -- tmux -2 attach -t 0 -d
}
@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>
@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() {
/*jshint unused:false */
function test(a, b) {
var c, d = 2;
return a + d;
}
test(1, 2);
//fine
@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" : {
@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:
[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
// everyone's new favorite closure pattern:
(function(window,document,undefined){ ... })(this,this.document);
// when minified:
(function(w,d,u){ ... })(this,this.document);
// which means all uses of window/document/undefined inside the closure
// will be single-lettered, so big gains in minification.
// it also will speed up scope chain traversal a tiny tiny little bit.