Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/php
<?php
/**
* YUI Compress CLI Util
*
* usage: (assuming the script is in your path, executable, and you are in the root directory of the files.)
*
* yuicompress.php javascript.js rollover.js links.js tabber/tabber-minimized.js utility_effects.js
*
* or
var myCookie;
myCookie = function(config) {
myCookie.superclass.constructor.apply(this,arguments);
};
Y.extend(myCookie, Y.Cookie, {
_createCookieString : function (name /*:String*/, value /*:Variant*/, encodeValue /*:Boolean*/, options /*:Object*/) /*:String*/ {
options = options || {};
Hi. Trying to validate a model inside the controller.
Thing is, I am trying to submit a few at once.
I've made the forms fields like so:
ShareMail.0.name,
ShareMail.0.email,
ShareMail.1.name,
ShareMail.1.email,
but am having trouble validating them in the controller.
<?php
/**
* Application Controller
*
*
* @package cake
* @subpackage cake.app
*/
class AppController extends Controller {
<?php
/**
* Find the index position of the nth occurrence of a string
*
* @param string $haystack Frag we looking for
* @param string $needle Frag we looking for
* @param int $nth
* @return false/int false on not found, else int of strpos
**/
// A plugin class designed to extend Y.Plugin.NodeMenuNav to allow pining of menu
// We want to allow a submenu to specify bltl, tlbr and so forth
function NavPinSubMenu() {
NavPinSubMenu.superclass.constructor.apply(this, arguments);
}
// Define Static properties NAME (to identify the class) and NS (to identify the namespace)
NavPinSubMenu.NAME = 'navPinSunMenu';
NavPinSubMenu.NS = 'menuNav';
@meeech
meeech / yui3-node-menunav-mod.js
Created October 15, 2010 17:19
Modified the node menunav to have pinning to bottom right of parent to top right of submenu.
YUI.add('node-menunav', function(Y) {
/**
* <p>The MenuNav Node Plugin makes it easy to transform existing list-based
* markup into traditional, drop down navigational menus that are both accessible
* and easy to customize, and only require a small set of dependencies.</p>
*
*
* <p>To use the MenuNav Node Plugin, simply pass a reference to the plugin to a
* Node instance's <code>plug</code> method.</p>
@meeech
meeech / posterous - theme
Created November 18, 2010 22:34
download and save the index.html
#!/usr/bin/env ruby
require 'net/http'
require 'uri'
require 'rubygems'
require 'json'
require 'config.rb'
# puts URI.escape($posterous_auth_email)
theme_url = "http://posterous.com/api/2/users/#{$posterous_user_id}/sites/#{$posterous_site_id}/theme?api_token=#{$posterous_api_token}"
// Create new YUI instance, and populate it with the required modules
YUI().use('autocomplete', function(Y) {
//Begin Closure
//Used to parse out the JSONP reponse from the server.
YUI.namespace('Vault.ac').parseResponse = function(results) {
return results;
};
if(Y.one('#q')) {
@meeech
meeech / posterous-theme.rb
Created November 24, 2010 07:34
Fetch your posterous theme. my first rb script.
#!/usr/bin/env ruby
# script that goes and fetches your posterous.com theme file.
require 'net/http'
require 'uri'
require 'rubygems'
require 'json'
# config.rb should contain all the global vars found in this script.
require 'config.rb'