Showing latest added snippets.

randomize array - Snippet icon randomize array
  1. NSUInteger count = [yourMutableArray count];
  2. for (NSUInteger i = 0; i < count; ++i) {
  3. // Select a random element between i and end of array to swap with.
  4. int nElements = count - i;
  5. int n = (arc4random() % nElements) + i;
  6. [yourMutableArray exchangeObjectAtIndex:i withObjectAtIndex:n];
  7. }
See the complete snippet
Language: Objective-C
Tags:
Submitted By: balzan
Adding Bundles - Snippet icon Adding Bundles
  1. Code Collector Pro allows you to add bundles to expand the list of languages available allowing them to have their syntax coloured. Code Collector Pro supports TextMate bundles, which are available from the online bundle respository (http://macromates.com/svn/Bundles/trunk/). Once you have downloaded a bundle you can add it by going into Preferences and clicking on the + button in the bundles sect
See the complete snippet
Language: Other
Tags:
Submitted By: smeders
C Starter - Snippet icon C Starter
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. printf("Hello World");
  5. return 0;
  6. }
See the complete snippet
Language: C
Tags:
Submitted By: smeders
PHP Starter - Snippet icon PHP Starter
  1. <?php
  2. print "Hello World";
  3. ?>
See the complete snippet
Language: PHP
Tags:
Submitted By: smeders
Java Starter - Snippet icon Java Starter
  1. class HelloWorld {
  2. public static void main(String args[]) {
  3. System.out.print("Hello World");
  4. }
  5. }
See the complete snippet
Language: Java
Tags:
Submitted By: smeders
XHTML 1.0 Transitional - Snippet icon XHTML 1.0 Transitional
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3.  
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6. <title>untitled</title>
  7. </head>
  8.  
  9. </body>
  10. </html>
See the complete snippet
Language: HTML
Tags:
Submitted By: smeders
HTML 4.01 Transitional - Snippet icon HTML 4.01 Transitional
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html lang="en">
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>untitled</title>
  6. </head>
  7.  
  8. </body>
  9. </html>
See the complete snippet
Language: HTML
Tags:
Submitted By: smeders
XHTML 1.0 Strict - Snippet icon XHTML 1.0 Strict
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3.  
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6. <title>untitled</title>
  7. </head>
  8.  
  9. </body>
  10. </html>
See the complete snippet
Language: HTML
Tags:
Submitted By: smeders
Getting Started - Snippet icon Getting Started
  1. Welcome to Code Collector Pro. Using Code Collector Pro is pretty simple. To add or remove a snippet simply click on the toolbar icons above. To add a group or smart group use the buttons at the bottom of the source list. You can edit snippet details by bringing up the snippet info window from the window menu.
  2.  
  3. We've included some snippets and groups to get you started
See the complete snippet
Language: Other
Tags:
Submitted By: smeders
Objective-C Starter - Snippet icon Objective-C Starter
  1. #import <Foundation/Foundation.h>
  2.  
  3. int main (int argc, const char * argv[]) {
  4. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  5.  
  6. NSLog(@"Hello World");
  7. [pool release];
  8. return 0;
  9. }
See the complete snippet
Language: Objective-C
Tags:
Submitted By: smeders
HTML 4.01 Strict - Snippet icon HTML 4.01 Strict
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/strict.dtd">
  3. <html lang="en">
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>untitled</title>
  6. </head>
  7.  
  8. </body>
  9. </html>
See the complete snippet
Language: HTML
Tags:
Submitted By: smeders
Find Folder in Finder - Snippet icon Find Folder in Finder
  1. Method 1: From the Terminal, type "open -a Finder /usr/local/bin".
  2.  
  3. Method 2: From Finder's "Go" menu, select "Go to folder...". That'll bring up a window in which you can type "/usr/local/bin".
See the complete snippet
Language: Other
Tags:
Submitted By: sheryl
config Logs Writing to File - Snippet icon config Logs Writing to File
  1. <?php
  2. // log errors and warnings
  3. SS_Log::add_writer(new SS_LogFileWriter('../silverstripe-errors-warnings.log'), SS_Log::WARN, '<=');
  4. SS_Log::add_writer(new SS_LogFileWriter('../silverstripe-errors.log'), SS_Log::ERR);
  5.  
See the complete snippet
Language: PHP
Tags:
Submitted By: balzan
Model Admins with Custom Images - Snippet icon Model Admins with Custom Images
  1. <?php
  2. class UserMessageAdmin extends ModelAdmin {
  3.  
  4. static $menu_icon = 'mysite/images/picture_16.png';
  5.  
  6. private static $managed_models = array(
  7. "UserMessage"
  8. );
  9.  
  10. private static $menu_title = "User Messages";
  11. private static $url_segment = "usermessages";
  12. private static $menu_priority = 14;
  13.  
  14.  
  15. public function getEditForm($id = null, $fields = null) {
  16. $form=
See the complete snippet
Language: PHP
Tags:
Submitted By: balzan
XHTML 1.0 Strict - Snippet icon XHTML 1.0 Strict
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3.  
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6. <title>untitled</title>
  7. </head>
  8.  
  9. </body>
  10. </html>
See the complete snippet
Language: HTML
Tags:
Submitted By: sonyxs
HTML 4.01 Strict - Snippet icon HTML 4.01 Strict
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/strict.dtd">
  3. <html lang="en">
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>untitled</title>
  6. </head>
  7.  
  8. </body>
  9. </html>
See the complete snippet
Language: HTML
Tags:
Submitted By: sonyxs
HTML 4.01 Transitional - Snippet icon HTML 4.01 Transitional
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html lang="en">
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>untitled</title>
  6. </head>
  7.  
  8. </body>
  9. </html>
See the complete snippet
Language: HTML
Tags:
Submitted By: sonyxs
Getting Started - Snippet icon Getting Started
  1. Welcome to Code Collector Pro. Using Code Collector Pro is pretty simple. To add or remove a snippet simply click on the toolbar icons above. To add a group or smart group use the buttons at the bottom of the source list. You can edit snippet details by bringing up the snippet info window from the window menu.
  2.  
  3. We've included some snippets and groups to get you started
See the complete snippet
Language: Other
Tags:
Submitted By: sonyxs
Code Collector Pro Header Image

Get Code Collector Pro

Code Collector Pro is a storage app for code snippets. From HTML to Cocoa, C++ to Ruby, Code Collector Pro looks after all your code snippets, letting you quickly reference them whenever you want.

Find out more » Download Code Collector Pro 1.6.4

Web Analytics