Skip to content

Instantly share code, notes, and snippets.

View joedeveloper's full-sized avatar

joedeveloper

View GitHub Profile
addDrag: function(v){
var group = ['child'];
if(v.hasClass('story')){
group = ['story'];
}
var dd = new Y.DD.Drag({
node: v,
groups: group,
target: {
padding: '0 0 0 20'
/**
* Copyright (C) 2010 joe.d.developer@gmail.com
* Released under AGPL, http://www.gnu.org/licenses/agpl.html.
*
* Helper function to break up processing of large sets
* uses yui asyncqueue internally
* @param set {array} array to iterate over.
* @param fn {function} function to call on each item
* @param co {object} optional context object
* @param cb {fn} optional function to call when all processing is complete.
YUI.add('plugin-panorama', function(Y){
var TRIGGER_CLASS = '.item';
Y.namespace('Plugin').Panorama = Y.Base.create('panorama', Y.Plugin.Base, [], {
_host : null,
_mouseMove : null,
var ddDel = new Y.DD.Delegate({
container: container,
nodes: selector,
dragConfig:{groups: groups},
target:true
});
@joedeveloper
joedeveloper / gist:1665267
Created January 23, 2012 20:03
YUI3 View Plugin
YUI.add('unomi-view-plugin-clipboard', function (Y) {
var NSVP = Y.namespace('Unomi.View.Plugin');
/**
* Adds flash based clipboard functionality to a page.
* The default behavior is to react to mouseover events of elements with
* a "data-action"="clipboard" attribute and expect it to wrap an A tag with the relevant text to be copied
* This behavior can be modified by intercepting the "syncClipBoard" event.
* See usage example in javascripts/unomi/view/support_tool/unomi-view-support_tool-ticketlist.js
* @extends Plugin
@joedeveloper
joedeveloper / gist:1667487
Created January 24, 2012 02:48
Adventures in LVM
Credit due: http://www.linuxquestions.org/questions/fedora-35/lvm-partition-resizing-666683/
fdisk resize per above, reboot.
pvresize /dev/sda2
lvresize /dev/vg_scilux1/lv_root -l +100%FREE -r
done.
@joedeveloper
joedeveloper / gist:1731427
Created February 3, 2012 18:03
Ancient script loader
/** helper function to dynamically include js */
var js;
function include_js(file) {
var html_doc = document.getElementsByTagName('head')[0];
js = document.createElement('script');
js.setAttribute('type', 'text/javascript');
js.setAttribute('src', file);
html_doc.appendChild(js);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "/",
"type": "object",
"description": "Results returned by WIN UAT API for successful AWBno searches",
"properties": {
"AirlineName": {
"id": "AirlineName",
"type": "string",
"description": "Human Readable Airline name.",
{
"AirlineName": "China Airlines Cargo",
"AirlinePrefix": "297",
"AirlineCodeIATA": "CI",
"AwbNumber": "30169624",
"Statuses": [
{
"AirportCode": "BKK",
"Details": [
{