Skip to content

Instantly share code, notes, and snippets.

View paulallies's full-sized avatar
🖥️
Coding

Paul Allies paulallies

🖥️
Coding
View GitHub Profile
@paulallies
paulallies / YUI.examples.gallery.accordion.js
Created August 31, 2011 10:04
YUI3 gallery-accordion
@paulallies
paulallies / tabview.js
Created August 31, 2011 11:26
YUI3 tabview
//Requires the following modules
requires: 'tabview'
//Declare tabview
var myTabview = new Y.TabView({
srcNode: "#tree"
});
//select a tab of index 0
myTabview.selectChild(0);
@paulallies
paulallies / ajax.get.js
Created August 31, 2011 20:50
YUI3 Ajax GET
Y.io(uri, {
on: {
success: function (txnid, res) {
Y.one('#container').set('innerHTML', res.responseText);
},
failure: function (err, res) {
Y.log(res.status + ":" + res.statusText);
}
}
});
@paulallies
paulallies / modal.js
Created September 2, 2011 19:09
Modal
requires: yui2-container
//declaration
var YAHOO = Y.YUI2;
var myPopup = function (modalElement) {
//create a locally scoped YUI panel
var modal = new YAHOO.widget.Panel(modalElement, {
fixedcenter: true,
visible: false,
@paulallies
paulallies / YUIAjaxPost.js
Created September 11, 2011 11:39
Ajax Posr
var cfg = {
method: 'POST',
data: '{"clientname": "Test"}',
headers: { 'Content-Type': 'application/json' },
on: { success: function (id, o, args) {
Y.log('Success');
},
failure: function () {
Y.log('Post Error');
}
@paulallies
paulallies / git.txt
Created September 13, 2011 11:03
Git Commands
Initialise repository: git init
Remote add: git remote add appharbor https://paulallies@appharbor.com/nanotouch.git
Add files to repository: git add .
Check in: git commit -m 'Updated'
Push to repository: git push appharbor master
@paulallies
paulallies / AO.js
Created September 16, 2011 20:07
Arrays and Objects
//Bad way to declare objects and arrays
var person = new Object(),
keys = new Array();
//A better way is to use object literals
var person = {},
keys = [];
//Example
var person = {
@paulallies
paulallies / testshit.js
Created June 5, 2012 19:57
this is a test
var test = function(){
console.log('hello from github');
};
@paulallies
paulallies / testshit.js
Created June 5, 2012 19:57
this is a test
var test = function(){
alert('hello from github');
};
var https = require('https');
var test = "";
var host = 'api.mongolab.com';
var options = {
host: host,
port: 443,
path: "/",
method: 'GET'
};
var YUI = require("yui").YUI;