CodeCollector.net

The best way to share and discover code snippets!

Code Collector Pro Header Image

Collections

Collections are groups similarly related code snippet groups. For example our first two collections are for Rapidweaver and Wordpress with more coming soon. Collections are based 100% on user demand, by submitting more snippets for a given topic we are likely to make a collection around it.

Share to everyone

Share your discovered snippets or snippets from your library through any social network (Twitter, Facebook, Google+, you name it).

Access from anywhere

Using our responsively designed website, you can access your snippets from anywhere and pretty much any device (mobile, computer, tablet, web), all you need is a internet connection.

Tightly Integrated

CodeCollector.net has tight integration with Code Collector Pro, the Mac based Snippet manager. You can easily share and backup your snippet collection. Once they are in the cloud they are accessible from anywhere with a connection and browser. More Info »



Latest Snippets

Widget Candy. .NewButton() - Snippet icon Widget Candy. .NewButton()
  1.  
  2.  
  3. WIDGET CANDY FOR CORONA & GIDEROS iPHONE ANDROID SDK Creates a button, showing an icon and text of your choice. Use the textAlign property (see Widget Properties) to display the icon to the left or right of the text, also to align the text caption.
  4.  
  5. A button's icon size is defined in the theme's lua file. See 'ButtonIconSize' there. Text buttons can be auto-sized (if there width property is set
See the complete snippet
Language: Other
Tags: No Tags
Submitted By: sierramanagement
Widget Candy. .NewWindow() - Snippet icon Widget Candy. .NewWindow()
  1.  
  2. WIDGET CANDY FOR CORONA & GIDEROS iPHONE ANDROID SDK Creates a window widget. Window widgets can hold other widgets and even arrange (layout) them automatically for you. Window widgets can be dragged (horizontally, vertically, or both) within a specified drag area, which is the screen size, for example. Window widgets also provide a close button to let them disappear again.
  3.  
  4. To add any widget to
See the complete snippet
Language: Other
Tags: No Tags
Submitted By: sierramanagement
Widget Candy GENERAL WIDGET METHODS - Snippet icon Widget Candy GENERAL WIDGET METHODS
  1.  
  2. MyWidget:show ( state, fadeDuration )
  3.  
  4. state (Boolean) Shows (true) or hides (false) the widget.
  5.  
  6. fadeDuration (Number) If specified, the widget will smoothly fade in or out, using the specified duration for the fade effect.
  7. —————————————
  8.  
  9. MyWidget:enable ( state )
  10.  
  11. state (Boolean) Enables (true) or disables (false) the widget. If disabled, the widget will appear greyed-
See the complete snippet
Language: Other
Tags: No Tags
Submitted By: sierramanagement
Widget Candy. GENERAL LAYOUT PROPERTIES - Snippet icon Widget Candy. GENERAL LAYOUT PROPERTIES
  1. Use these widget properties to control the automatic layout of the widget:
  2.  
  3. includeInLayout (Boolean) True or false. If set to true (default), this widget will be taken into account for automatic layouting. This means, the next widget that is placed within the same window will be positioned next to this widget. If set to false, this widget will be ignored by the automatic layout system.
  4.  
  5. newLayout
See the complete snippet
Language: Other
Tags: No Tags
Submitted By: sierramanagement
Widget Candy. .Show() - Snippet icon Widget Candy. .Show()
  1.  
  2.  
  3.  
  4. Shows or hides a widget, with or without a fade animation.
  5.  
  6. -- LOAD THE LIBRARY AND USE A GLOBAL VAR TO STORE A REFERENCE:
  7. _G.GUI = require("widget_candy")
  8.  
  9. -- CREATE A BUTTON
  10. _G.GUI.NewButton(
  11. {
  12. x = 50,
  13. y = 50,
  14. theme = "MyTheme",
  15. name = "Button1",
  16. caption = "HELLO!",
  17. } )
  18.  
  19. -- FADE-OUT AND HIDE THE BUTTON
  20. _G.GUI.Show("Button1", false, true )
  21.  
  22. Show (widgetName, isVisible,
See the complete snippet
Language: Other
Tags: No Tags
Submitted By: sierramanagement
Widget Candy. .Get() - Snippet icon Widget Candy. .Get()
  1.  
  2.  
  3. Returns the current value of the specified widget property.
  4.  
  5. -- LOAD THE LIBRARY AND USE A GLOBAL VAR TO STORE A REFERENCE:
  6. _G.GUI = require("widget_candy")
  7.  
  8. -- CREATE A BUTTON
  9. _G.GUI.NewButton(
  10. {
  11. x = 50,
  12. y = 50,
  13. theme = "MyTheme",
  14. name = "Button1",
  15. caption = "HELLO!",
  16. } )
  17.  
  18. -- GET THE CAPTION OF THIS BUTTON
  19. print( _G.GUI.Get("Button1", "caption") )
  20.  
  21. GetHandle (widgetName,
See the complete snippet
Language: Other
Tags: No Tags
Submitted By: sierramanagement
Widget Candy. .Set() - Snippet icon Widget Candy. .Set()
Widget Candy
  1.  
  2.  
  3. Changes a widget's properties (either a single property or multiple properties at once). It's basically the same as using a widget's :set() method -whatever you prefer.
  4.  
  5. -- LOAD THE LIBRARY AND USE A GLOBAL VAR TO STORE A REFERENCE:
  6. _G.GUI = require("widget_candy")
  7.  
  8. -- CREATE A BUTTON
  9. _G.GUI.NewButton(
  10. {
  11. x = 50,
  12. y = 50,
  13. theme = "MyTheme",
  14. name = "Button1",
  15. caption = "HI!"
See the complete snippet
Language: Other
Tags: No Tags
Submitted By: sierramanagement
Widget Candy. .GetHandle() - Snippet icon Widget Candy. .GetHandle()
Widget Candy
  1.  
  2.  
  3. Each command that creates a widget returns a reference (handle) to the created widget. You can either store this handle within a variable at creation time or use the .GetHandle() command at any later time to get the handle of a certain widget.
  4.  
  5. The main purpose of the GetHandle() command is to eliminate the need to store any permanent references to your widgets. Remember, objects cannot be delet
See the complete snippet
Language: Other
Tags: No Tags
Submitted By: sierramanagement
Widget Candy. .RemoveAllWidgets() - Snippet icon Widget Candy. .RemoveAllWidgets()
Widget Candy
  1.  
  2.  
  3. Removes (deletes) all existing widgets. If the "unloadThemes" parameter is set to true, all loaded themes are removed as well.
  4.  
  5. RemoveAllWidgets (unloadThemes)
  6.  
  7. unloadThemes (Boolean) If true, all loaded themes are removed as well.
See the complete snippet
Language: Other
Tags: No Tags
Submitted By: sierramanagement
Widget Candy. .UnloadTheme() - Snippet icon Widget Candy. .UnloadTheme()
Widget Candy
  1.  
  2.  
  3. Unloads a widget theme from memory and releases all related graphics and sounds from memory.
  4.  
  5. UnloadTheme (themeName)
  6.  
  7. themeName (String) The name of the theme to unload.
See the complete snippet
Language: Other
Tags: No Tags
Submitted By: sierramanagement



Most Popular Snippets

CRIBBS -- Cron Rsync Incremental Backup Bash Script - Snippet icon CRIBBS -- Cron Rsync Incremental Backup Bash Script
  1. #!/bin/bash
  2.  
  3. #######################################################
  4. # CRIBBS -- Cron Rsync Incremental Backup Bash Script #
  5. # AUTHOR: Adam Merrifield <http://adam.merrifield.ca> #
  6. # (and countless sources from the web) #
  7. # DATE: 05-26-11 23:17 #
  8. # VERSION: 1.0.0 #
  9. #######################################################
  10.  
  11. ##
See the complete snippet
Language: bash
Tags: cron rsync incremental backup bash cribbs
Submitted By: seyDoggy
FlexSlider - auto play and pause Youtube video in carousel - Snippet icon FlexSlider - auto play and pause Youtube video in carousel
  1. // Flexslider Initialiser with auto pause / play on Youtube Videos
  2. // &enablejsapi=1 needs to be present in the iframe SRC
  3.  
  4. $slider.flexslider({
  5. animationLoop: false,
  6. before: function(slider) {
  7. oldSlide = $( '.slides > li:nth-child(' + (slider.currentSlide + 1) + ')', $slider);
  8. youtubeVideo = oldSlide.find('iframe[src*=youtube]');
  9. if ( youtubeVideo.length ) {
  10. you
See the complete snippet
Language: Javascript
Tags: No Tags
Submitted By: mihai2u
Add/remove contact info fields - Snippet icon Add/remove contact info fields
Wordpress Users Custom Fields
  1. User profiles in WordPress by default have these fields for Contact Info by default: E-mail, Website, AIM, Yahoo IM, Jabber / Google Talk. You can remove those and add new ones as you wish, like in this example code for your functions.php file in your theme:
  2.  
  3. <?php
  4. function wptuts_contact_methods( $contactmethods ) {
  5.  
  6. // Remove we what we don't want
  7. unset( $contactmethods[ 'aim' ] );
See the complete snippet
Language: PHP
Tags: Wordpress
Submitted By: wpthemesbuilder
Magento Core: Add ShopZilla tracking codes - Snippet icon Magento Core: Add ShopZilla tracking codes
  1. ---------------
  2. Open:
  3. ---------------
  4.  
  5. /app/design/frontend/base/default/template/checkout/success.phtml
  6.  
  7.  
  8. ---------------
  9. Add To Bottom Of Page:
  10. ---------------
  11.  
  12. <!-- Shopzilla Tracking -->
  13. <!-- Start -->
  14.  
  15. <?php
  16. //Get Order Number & Order Total
  17. $order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
  18. $amount = number_format($order-
See the complete snippet
Language: Other
Tags: Core CE 1.6
Submitted By: Tamburra
Method Replacement (swizzle) - Snippet icon Method Replacement (swizzle)
  1. /* http://developer.apple.com/samplecode/MethodReplacement/listing3.html */
  2.  
  3. #import <AppKit/AppKit.h>
  4. #import <objc/runtime.h>
  5.  
  6. @interface NSWindow (TestMethodReplacement)
  7. - (void)TestMethodReplacement_sendEvent:(NSEvent *)event;
  8. @end
  9.  
  10. @implementation NSWindow (TestMethodReplacement)
  11.  
  12. + (void)load {
  13. if (self == [NSWindow class]) {
  14. // Swap the implementations of -[NSWindow sendEvent:]
See the complete snippet
Language: Objective-C
Tags: No Tags
Submitted By: powidl
Tibco CM Sender - Snippet icon Tibco CM Sender
  1.  
  2. /*
  3.  * Copyright (c) 1998-2002 TIBCO Software Inc.
  4.  * All rights reserved.
  5.  * TIB/Rendezvous is protected under US Patent No. 5,187,787.
  6.  * For more information, please contact:
  7.  * TIBCO Software Inc., Palo Alto, California, USA
  8.  *
  9.  * $Id: cmsender.java 12313 2005-11-23 18:08:58Z dleshc $
  10.  */
  11.  
  12.  
  13. /*
  14.  * cmsender - sends certified messages on specified subject.
  15.  *
  16.  * This example publishes certified m
See the complete snippet
Language: Java
Tags: No Tags
Submitted By: rlhatcher
diffEigen.R - Snippet icon diffEigen.R
Differentiation of generalized eigenvalues and singular values of matrices depending on parameters.
  1. #
  2. # diffEigen package
  3. # Copyright (C) 2007 Jan de Leeuw <[email protected]>
  4. # UCLA Department of Statistics, Box 951554, Los Angeles, CA 90095-1554
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option)
See the complete snippet
Language: R
Tags: Eigenvalues Singular Values Differentiation
Submitted By: deleeuw
Magento Core: Remove payment methods from frontend - Snippet icon Magento Core: Remove payment methods from frontend
  1. ---------------
  2. Notes:
  3. ---------------
  4.  
  5. http://www.magentocommerce.com/boards/viewthread/68490/#t301609
  6. You need to find the payment method code name to put into the array to be able to disable.
  7. Purchase Order: purchaseorder
  8. Check/Money Order: checkmo
  9. PayPal Express: paypal_express
  10.  
  11.  
  12. ---------------
  13. Open:
  14. ---------------
  15.  
  16. /app/design/frontend/base/default/template/checkout/onepage/payment/methods.
See the complete snippet
Language: Other
Tags: Core CE 1.6
Submitted By: Tamburra
Magento Core: (FIX) Order item status shows MIXED when it should show SHIPPED - Snippet icon Magento Core: (FIX) Order item status shows MIXED when it should show SHIPPED
  1. ---------------
  2. Open:
  3. ---------------
  4.  
  5. /app/code/core/Mage/Sales/Model/Order/Item.php
  6.  
  7.  
  8. ---------------
  9. Find:
  10. ---------------
  11.  
  12. if ($shipped && !$invoiced && ($actuallyOrdered == $shipped)) {
  13. return self::STATUS_SHIPPED;
  14. }
  15.  
  16.  
  17. ---------------
  18. Change To:
  19. ---------------
  20. if ($shipped && ($actuallyOrdered == $shipped) && ($actuallyOrdered == $invoiced)) {
  21. return self::STAT
See the complete snippet
Language: Other
Tags: Fix Core CE 1.6
Submitted By: Tamburra
Registration UH Username - Snippet icon Registration UH Username
  1. <?php
  2.  
  3. if (!isset($_POST['submit'])) {
  4.  
  5. echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
  6.  
  7. <html>
  8. <head>
  9. <title>UH Username Request Form</title>
  10.  
  11. <BODY>
  12. <div class=\"title\">
  13. University of Hawai'i Information Technology Services <BR>
  14. Department UH Username Request Form<BR><BR>
  15. </div>
  16.  
  17. <form action=\"/registration.php\" method = \"POST\">
  18.  
  19. <LABEL for=\"Name\">Name: </LABEL>
  20. <I
See the complete snippet
Language: PHP
Tags: No Tags
Submitted By: Bassglider

Trending Snippets

Web Analytics