This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You must download the yui3-files (for every version you want to serve) as well as the Gallery-modules. | |
Yui3 --> http://yuilibrary.com/yui/quick-start/ or https://github.com/yui/yui3 | |
Gallery --> download zip from https://github.com/yui/yui3-gallery | |
The Gist presumes the next directory-structure on the server: | |
/usr/local/yui_libraries/ | |
/usr/local/yui_libraries/yui3/ | |
/usr/local/yui_libraries/yui3/3.10.3/... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Wordnik demo from JavaScript</title> | |
<script src="http://static.smallpicture.com/bootstrap/js/jquery-1.9.1.min.js"></script> | |
<script> | |
var baseUrl = "http://api.wordnik.com/v4/word.json/"; | |
var apiKey = "a2a73e7b926c924fad7001ca3111acd55af2ffabf50eb4ae5"; //demo key from developer.wordnik.com | |
function getSynonyms (theWord, callback) { | |
var url = baseUrl + theWord + "/relatedWords?useCanonical=true&relationshipTypes=synonym&limitPerRelationshipType=100&api_key=" + apiKey; | |
var jxhr = $.ajax ({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = "https://"+un+":"+pw+"@twitter.com/statuses/update.json"; | |
var xhr = Titanium.Network.createHTTPClient(); | |
xhr.onload = function() { | |
// Handle response | |
}; | |
xhr.open("POST",url); | |
xhr.send({ status:'My awesome tweet!' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" | |
src="http://yui.yahooapis.com/3.2.0/build/simpleyui/simpleyui-min.js"></script> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Y.use('dd-drag', function(Y) { | |
var dd = new Y.DD.Drag({ | |
node: '#foo' | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sanitize URL — Validate it looks like a URL, then make it less dirty. | |
* | |
* Oddnut Software | |
* Copyright (c) 2010 Eric Ferraiuolo - http://eric.ferraiuolo.name | |
* MIT License - http://www.opensource.org/licenses/mit-license.php | |
* | |
* Examples: | |
* | |
* 'Http://WWW.example.com/' » 'http://www.example.com/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SERVER=https://api.no.de | |
SCRIPT="$0" | |
if [ ${SCRIPT:0:1} == "/" ]; then | |
SCRIPT="$(basename -- "$SCRIPT")" | |
fi | |
main () { | |
cmd=${1-help} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** CAREERS ***/ | |
var resumeSubmitBtn = Y.one('#job-submit-resume'), | |
friendSubmitBtn = Y.one('#job-send-to-a-friend'); | |
resumeSubmitBtn.on('click', function(e){ | |
// get xhr response text | |
Y.io('/xhr/submit-resume.php?title=' + Y.one('#job_title').get('value') + '&job_subject=' + Y.one('#job_subject').get('value'), { | |
on : { | |
success : function(id, o, args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://yui.yahooapis.com/3.2.0/build/yui/yui-min.js"></script> | |
<style> .red { color: red; } </style> | |
</head> | |
<body> | |
<div id="myDiv">Happy</div> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* An example of | |
* 1. Using the YUI 3 module system to encapsulate a custom class for reuse | |
* 2. Creating a Plugin class | |
* 3. Using Y.Base.create to generate the class | |
*/ | |
// YUI.add( | |
// "dash-separated-module-name", | |
// function (Y) { Y.MyModule = ...; }, |
OlderNewer