Skip to content

Instantly share code, notes, and snippets.

View jcreamer898's full-sized avatar
🏠
Working from home

Jonathan Creamer jcreamer898

🏠
Working from home
View GitHub Profile
@jcreamer898
jcreamer898 / README.md
Created July 13, 2012 21:18
Using amplifyjs as with RequireJS 2.0

Using AmplifyJS with RequireJS 2.0

With the lastest version of Require, a new config object was introduced, the shim.

http://requirejs.org/docs/api.html#config-shim

That allows Amplify to now be used within AMD projects.

Have Fun!

@jcreamer898
jcreamer898 / gist:3138563
Created July 18, 2012 20:11
A sublime snippet for console.log
<snippet>
<content><![CDATA[
console.log("${1:message}")
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>log</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
@jcreamer898
jcreamer898 / mouseMoveScroll.js
Created August 1, 2012 16:10
Using mousemove to create regions to trigger a scroll.
_setupEvents: function() {
this.$el.on( "click", "a.detail-content-trigger", this.openYear );
this.$el.on( "mousemove", _.throttle(this._checkMouse, 500));
},
_checkMouse: function( event ) {
var winWidth = $( window ).width(),
// Define some regions of the screen to toggle left and right scrolling.
screenRegions = {
Left: "0 300",
Middle: "300 " + (winWidth - 300),
@jcreamer898
jcreamer898 / zumbaHistory.js
Created August 2, 2012 17:55
zumbaHistory stuff
define(['jquery', "underscore"], function ( $, _ ) {
(function ( $, window, document, undefined ) {
// Create the defaults once
var pluginName = 'zumbaHistory',
defaults = {
colors: [ "purple", "blue", "yello", "orange" ],
extraScrollWidth: 400
};
@jcreamer898
jcreamer898 / amplify_sinon_qunit.js
Created August 13, 2012 16:39
Unit testing amplifyjs with qunit and sinon
module( "Product Viewer Personalization",
{
setup: function() {
OTC.App = {};
OTC.App.publish = amplify.publish;
OTC.App.on = amplify.subscribe;
OTC.App.off = amplify.unsubscribe;
this.pzn = new OTC.ProductViewer.Personalization();
}
@jcreamer898
jcreamer898 / README.md
Created October 1, 2012 17:20
anvil.js plugin boilerplate

anvil.js plugins

In this gist there's a plugin.js boilerplate for creating a new anvil plugin.

Also, there's a sublime snippet for the SB Text users out there.

var request = require( "request" );
var pluginFactory = function( _, anvil ) {
return anvil.plugin( {
// Name your plugin
name: "anvil.cdnjs",
// Activity list: "identify", "pull", "combine", "pre-process","compile", "post-process", "push", "test"
activity: "identify",
// Command all the things [ "-s, --somecommand", "Run this plugin for awesomesauce" ]
commander: [
@jcreamer898
jcreamer898 / index.js
Created October 21, 2012 04:33
Build csharp with anvil.js
var spawn = require( "child_process" ).spawn;
var pluginFactory = function(_, anvil) {
return anvil.plugin({
// Name your plugin
name: "anvil.csharp",
// Activity list: "identify", "pull", "combine", "pre-process","compile", "post-process", "push", "test"
activity: "identify",
// Command all the things [ "-s, --somecommand", "Run this plugin for awesomesauce" ]
commander: [
<!--
dd TTTTTTTTTT (( ))
dd TT (( )))
/aaaaa\ p\/ppp\ p\/pppp\ /eeee\ n\ nnnn\ /dddd\dd TT /oooo\ (( )))
/aa aa pp pp pp pp ee ee nnn nn dd ddd TT /oo oo\ (( )))
aa aa pp pp pp pp eeeeeee/ nn nn dd dd TT oo oo (( )))
aa a/a\ pp pp/ pp pp/ ee\ nn nn dd ddd TT \oo oo/ (( )))
:: \aaaa/ aa pp\ppp/ pp\ppp/ \eeeee nn nn \dddd \d TT \oooo/ ( ))
pp pp
/// <summary>
/// Links with data-role="button". Input-based buttons and button elements are auto-enhanced, no data-role required
/// </summary>
[TargetControlType(typeof(HtmlGenericControl))]
[TargetControlType(typeof(HtmlAnchor))]
[TargetControlType(typeof(HtmlButton))]
[TargetControlType(typeof(HtmlInputButton))]
[TargetControlType(typeof(Button))]
[TargetControlType(typeof(LinkButton))]
public class Button : LinkBase