Skip to content

Instantly share code, notes, and snippets.

View SlexAxton's full-sized avatar

Alex Sexton SlexAxton

View GitHub Profile
@SlexAxton
SlexAxton / asdf.js
Created August 22, 2011 22:47
sc view append
var appView = SC.View.create({ templateName: 'cool-guy-template' }).appendTo('body')
@SlexAxton
SlexAxton / wasdf.sh
Created August 25, 2011 18:28
bpm error out
$ gem install bpm
Fetching: libgems-0.0.5.gem (100%)
Fetching: gemcutter-0.6.1.gem (100%)
========================================================================
Thanks for installing Gemcutter! You can now run:
gem push merged into RubyGems 1.3.6
gem owner merged into RubyGems 1.3.6
@SlexAxton
SlexAxton / compileTemplates.js
Created August 26, 2011 21:52
Post precompiled SC.Handlebars
var sys = require("sys");
var Handlebars = require("handlebars");
var SC = { Handlebars : {} };
SC.Handlebars.Compiler = function() {};
SC.Handlebars.Compiler.prototype = Object.create( Handlebars.Compiler.prototype );
SC.Handlebars.Compiler.prototype.compiler = SC.Handlebars.Compiler;
SC.Handlebars.JavaScriptCompiler = function() {};
@SlexAxton
SlexAxton / 01-package.json
Created September 2, 2011 05:23
Compiling Sproutcore Handlebars Templates on the Server
{ "description" : "Sproutcore Handlebars Precompiler"
, "version" : "0.1.0"
, "author" : "Alex Sexton <Alex.Sexton@bazaarvoice.com>"
, "engines" : ["node >=0.4.7"]
, "main" : "./lib/main"
, "dependencies": {
"handlebars": "1.0.x"
}
}
@SlexAxton
SlexAxton / 01-tmpl.js
Created September 15, 2011 20:30
tmpl requirejs plugin
// START Handlebars
var Handlebars = {
precompile: function(){},
compile : function(){},
template : function(){}
};
define( 'Handlebars', [], function(){
return Handlebars;
});
@SlexAxton
SlexAxton / so.js
Created September 16, 2011 05:43
aaron
var $banner = $('#banner');
$('#github_user').focus(function(){
$banner.fadeOut();
}).blur(function(){
$banner.fadeIn();
});
@SlexAxton
SlexAxton / more.css
Created September 16, 2011 06:17
new styles
.message {
position: fixed;
top: 10px;
border: 1px solid;
margin: 10px 0px;
padding: 15px 10px;
color: #BD5D83;
background-color: whiteSmoke;
width: 960px;
font-size: 18px;
@SlexAxton
SlexAxton / 01-tmpl.js
Created November 3, 2011 04:12
Handlebars require.js integration
/**
* @license handlebars tmpl 0.1.0 - Alex Sexton, but Handlebars has it's own licensing junk
*
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/require-cs for details on the plugin this was based off of
*/
/* Yes, deliciously evil. */
/*jslint evil: true, strict: false, plusplus: false, regexp: false */
/*global require: false, XMLHttpRequest: false, ActiveXObject: false,
@SlexAxton
SlexAxton / jConstruct.js
Created December 22, 2011 20:20
jQuery constructor recreation attempt
(function (window, undefined) {
var MRTN = (function() {
// The main FeedTheWebDev function
var MRTN = function(element) {
return new MRTN.fn.init(element, rootDoc);
},
// Ref to root document
rootDoc;
@SlexAxton
SlexAxton / File.js
Created January 7, 2012 21:48
JavaScript Code Improver output
(function()
{
function getScriptUrl(re)
{
var scripts = document.getElementsByTagName('script'),
element,
src;
for (var i = 0; i < scripts.length; i++)
{
element = scripts[i];