Skip to content

Instantly share code, notes, and snippets.

@patocallaghan
patocallaghan / repeat.aspx
Created August 22, 2012 23:03
.Net Repeater functionality #csharp #repeater
////Adding this so I don't forget
/*
In code-behind
var list = GetList();
repeaterId.DataSource = list;
repeaterId.DataBind();
*/
<asp:repeater runat="server" id="spiceimages">
<HeaderTemplate>
@patocallaghan
patocallaghan / scroller.js
Created August 24, 2012 03:02
jQuery scrolling animation #js #javascript #jquery #scroll
$( 'html,body' ).animate( { scrollTop: $( id ).position().top }, 500, 'easeInOutExpo' );
@patocallaghan
patocallaghan / swfload.js
Created September 17, 2012 22:21
Check if some object exists before we load it e.g. swfobject (use typeof so it works in oldIE) #js #swfobject #ie8
(function swfEmbed() {
if ( typeof swfobject === 'undefined' ) {
setTimeout( function () { swfEmbed(); }, 100 );
} else {
var vars = { xmlPath: '/RotatorXml', linkCol: '#ffffff' };
var params = {};
var attributes = {};
swfobject.embedSWF( "/flash/HomepageRotator.swf", "rotator-homepage-flash", "796", "428", "9.0.0", "/flash/expressInstall.swf", vars, params, attributes );
}
} )();
➜ embercom git:(ember-cli-upgrade-master) ✗ npm install -g ember-cli@1.13.11
npm WARN install:esprima@1.0.4 ENOENT: no such file or directory, chmod '/Users/patocallaghan/.nvm/versions/node/v5.0.0/lib/node_modules/ember-cli/node_modules/bower/node_modules/ca
rdinal/node_modules/redeyed/node_modules/esprima/bin/esparse.js'
npm WARN install:esprima@2.6.0 ENOENT: no such file or directory, chmod '/Users/patocallaghan/.nvm/versions/node/v5.0.0/lib/node_modules/ember-cli/node_modules/bower/node_modules/co
nfigstore/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js'
npm WARN install:nopt@1.0.10 ENOENT: no such file or directory, chmod '/Users/patocallaghan/.nvm/versions/node/v5.0.0/lib/node_modules/ember-cli/node_modules/bower/node_modules/deco
mpress-zip/node_modules/touch/node_modules/nopt/bin/nopt.js'
npm WARN install:mime@1.3.4 ENOENT: no such file or directory, chmod '/Users/patocallaghan/.nvm/versions/node/v5.0.0/lib/node_modules/ember-cli/node_modules/bower/node_modules/githu
b/node_modules/mime/c
@patocallaghan
patocallaghan / grunt-init-templates.bat
Last active December 16, 2015 13:18
Grunt-init templates: Commands to install grunt-init and grunt templates onto a Windows machine.
git clone https://github.com/gruntjs/grunt-init-jquery.git %USERPROFILE%/.grunt-init/jquery
git clone https://github.com/gruntjs/grunt-init-gruntfile.git %USERPROFILE%/.grunt-init/gruntfile
git clone https://github.com/gruntjs/grunt-init-gruntplugin.git %USERPROFILE%/.grunt-init/gruntplugin
git clone https://github.com/gruntjs/grunt-init-node.git %USERPROFILE%/.grunt-init/node
git clone https://github.com/gruntjs/grunt-init-commonjs.git %USERPROFILE%/.grunt-init/commonjs
npm install -g grunt-init
@patocallaghan
patocallaghan / docpad-debug-docpad-plugin
Created May 22, 2013 09:06
docpad-plugin-partials debug log
debug: Plugins loading for: C:\dev\inuit.css-kitchensink\node_modules
→ [2013-05-22 20:54:43.362] [C:\Users\jaimefox\AppData\Roaming\npm\node_modules\docpad\out\lib\docpad.js] [DocPad.log]
debug: Loading plugin: eco
→ [2013-05-22 20:54:43.389] [C:\Users\jaimefox\AppData\Roaming\npm\node_modules\docpad\out\lib\docpad.js] [DocPad.log]
debug: Loading plugin: livereload
→ [2013-05-22 20:54:43.401] [C:\Users\jaimefox\AppData\Roaming\npm\node_modules\docpad\out\lib\docpad.js] [DocPad.log]
debug: Loading plugin: marked
→ [2013-05-22 20:54:43.411] [C:\Users\jaimefox\AppData\Roaming\npm\node_modules\docpad\out\lib\docpad.js] [DocPad.log]
debug: Loading plugin: partials
→ [2013-05-22 20:54:43.421] [C:\Users\jaimefox\AppData\Roaming\npm\node_modules\docpad\out\lib\docpad.js] [DocPad.log]
netstat -a -n -o
TaskKill.exe /PID <value>
@patocallaghan
patocallaghan / docpad-run.bat
Created July 27, 2013 10:57
Run docpad locally
node ./node_modules/docpad/bin/docpad run
@patocallaghan
patocallaghan / chai-jquery-expect.md
Last active December 20, 2015 15:29
Chai jQuery plugin examples. Uses `expect` style. Examples from http://chaijs.com/plugins/chai-jquery. #sinon #chai #javascript #jquery

#Chai jQuery

##.attr(name[, value])

expect($('body')).to.have.attr('foo', 'bar');
expect($('body')).to.have.attr('foo').match(/bar/);

##.css(name[, value])