Showing latest added snippets.

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: sonyxs
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: sonyxs
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: sonyxs
PHP Starter - Snippet icon PHP Starter
  1. <?php
  2. print "Hello World";
  3. ?>
See the complete snippet
Language: PHP
Tags:
Submitted By: sonyxs
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: sonyxs
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: sonyxs
reversed Array - Snippet icon reversed Array
  1. NSArray* reversedArray = [[startArray reverseObjectEnumerator] allObjects];
See the complete snippet
Language: Objective-C
Tags:
Submitted By: balzan
enable iTunes File Sharing - Snippet icon enable iTunes File Sharing
  1. add UIFileSharingEnabled key in info.plist to YES
  2. add CFBundleDisplayName key to info.plist to application name
See the complete snippet
Language: Objective-C
Tags:
Submitted By: balzan
SecondViewController.swift - Snippet icon SecondViewController.swift
  1. import Foundation
  2. import UIKit
  3.  
  4. class SecondViewController: UIViewController {
  5. @IBOutlet weak var notificationLabel: UILabel!
  6.  
  7. override func viewDidLoad() {
  8. super.viewDidLoad()
  9.  
  10. // 3. Observe (listen for) "special notification key"
  11. NSNotificationCenter.defaultCenter().addObserver(self, selector: "actOnSpecialNotification", name: mySpecialNotificationKey, object: nil)
  12. }
  13.  
  14.  
See the complete snippet
Language: Swift
Tags:
Submitted By: durul
ThirdViewController.swift - Snippet icon ThirdViewController.swift
  1. import Foundation
  2. import UIKit
  3.  
  4. class ThirdViewController: UIViewController {
  5. @IBOutlet weak var notificationLabel: UILabel!
  6.  
  7. override func viewDidLoad() {
  8. super.viewDidLoad()
  9.  
  10. NSNotificationCenter.defaultCenter().addObserver(self, selector: "actOnSpecialNotification", name: mySpecialNotificationKey, object: nil)
  11. }
  12.  
  13. func actOnSpecialNotification() {
  14. self.notificationLabel.text
See the complete snippet
Language: Swift
Tags:
Submitted By: durul
FirstViewController.swift - Snippet icon FirstViewController.swift
  1. import Foundation
  2. import UIKit
  3.  
  4. // 1. Globally define a "special notification key" constant that can be broadcast / tuned in to...
  5.  
  6. let mySpecialNotificationKey = "com.durul.specialNotificationKey"
  7.  
  8. class FirstViewController: UIViewController {
  9. @IBOutlet weak var sentNotificationLabel: UILabel!
  10.  
  11. override func viewDidLoad() {
  12. super.viewDidLoad()
  13.  
  14. // 2. Post notification using "
See the complete snippet
Language: Swift
Tags:
Submitted By: durul
MessageComposer.swift - Snippet icon MessageComposer.swift
  1. import Foundation
  2. import MessageUI
  3.  
  4. let textMessageRecipients = ["1-800-867-5309"] // for pre-populating the recipients list (optional, depending on your needs)
  5.  
  6. class MessageComposer: NSObject, MFMessageComposeViewControllerDelegate {
  7.  
  8. // A wrapper function to indicate whether or not a text message can be sent from the user's device
  9. func canSendText() -> Bool {
  10. return MFMessageComposeViewCon
See the complete snippet
Language: Swift
Tags:
Submitted By: durul
ViewController.swift - Snippet icon ViewController.swift
  1. import UIKit
  2.  
  3. class ViewController: UIViewController {
  4. // Create a MessageComposer
  5. let messageComposer = MessageComposer()
  6.  
  7. @IBAction func sendTextMessageButtonTapped(sender: UIButton) {
  8. // Make sure the device can send text messages
  9. if (messageComposer.canSendText()) {
  10. // Obtain a configured MFMessageComposeViewController
  11. let messageComposeVC = messageComposer.configuredMessageCompo
See the complete snippet
Language: Swift
Tags:
Submitted By: durul
ViewController.swift - Snippet icon ViewController.swift
  1. import Foundation
  2. import UIKit
  3.  
  4. class ViewController: UIViewController {
  5. let emailComposer = EmailComposer()
  6.  
  7. @IBAction func sendEmailButtonTapped(sender: AnyObject) {
  8.  
  9. let configuredMailComposeViewController = emailComposer.configuredMailComposeViewController()
  10. if emailComposer.canSendMail() {
  11. presentViewController(configuredMailComposeViewControlle
See the complete snippet
Language: Swift
Tags:
Submitted By: durul
EmailComposer.swift - Snippet icon EmailComposer.swift
  1. import Foundation
  2. import MessageUI
  3.  
  4. class EmailComposer: NSObject, MFMailComposeViewControllerDelegate {
  5. func canSendMail() -> Bool {
  6. return MFMailComposeViewController.canSendMail()
  7. }
  8.  
  9. func configuredMailComposeViewController() -> MFMailComposeViewController {
  10. let mailComposerVC = MFMailComposeViewController()
  11. mailComposerVC.mailComposeDelegate = self
  12.  
See the complete snippet
Language: Swift
Tags:
Submitted By: durul
Calculator.m - Snippet icon Calculator.m
  1. //
  2. // Calculator.m
  3. // myCalculator
  4. //
  5. // Created by Steve Kochan on 5/7/09.
  6. // Copyright 2009 __MyCompanyName__. All rights reserved.
  7. //
  8.  
  9. #import "Calculator.h"
  10.  
  11. @implementation Calculator
  12. -(void) clear
  13. {
  14. accumulator = 0.0;
  15. }
  16.  
  17. -(void) setAccumulator: (double) value;
  18. {
  19. accumulator = value;
  20. }
  21.  
  22. -(double) accumulator;
  23. {
  24. return accumulator;
  25. }
  26.  
  27. -(void) add: (double) value
  28. {
  29. accumulat
See the complete snippet
Language: Objective-C
Tags:
Submitted By: durul
Calculator.h - Snippet icon Calculator.h
  1. //
  2. // Calculator.h
  3. // myCalculator
  4. //
  5. // Created by Steve Kochan on 5/7/09.
  6. // Copyright 2009 __MyCompanyName__. All rights reserved.
  7. //
  8.  
  9. #import <Foundation/Foundation.h>
  10.  
  11.  
  12. @interface Calculator : NSObject {
  13. double accumulator;
  14. }
  15.  
  16. -(void) clear;
  17. -(void) setAccumulator: (double) value;
  18. -(double) accumulator;
  19. -(void) add: (double) value;
  20. -(void) subtract: (double) value;
  21. -(void) multiply:
See the complete snippet
Language: C
Tags:
Submitted By: durul
myCalculator.m - Snippet icon myCalculator.m
  1. #import <Foundation/Foundation.h>
  2. #import "Calculator.h"
  3.  
  4. int main (int argc, const char * argv[]) {
  5. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  6. Calculator * myCalc = [[Calculator alloc] init];
  7.  
  8. [myCalc setAccumulator: 10.0];
  9. [myCalc add: 100];
  10. [myCalc multiply: 5];
  11. [myCalc divide: 3.0];
  12. NSLog (@"The accumulator is %g", [myCalc accumulator]);
  13.  
  14.  
See the complete snippet
Language: Objective-C
Tags:
Submitted By: durul
2-Fraction2c.m - Snippet icon 2-Fraction2c.m
  1. #import <Foundation/Foundation.h>
  2. #import <AddressBook/AddressBook.h>
  3. #import "Price.h"
  4. #import "Fraction.h"
  5. #include <sys/socket.h>
  6. #include <sys/sysctl.h>
  7. #include <net/if.h>
  8. #include <net/if_dl.h>
  9.  
  10. /*
  11. int main (int argc, const char * argv[]) {
  12.   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  13.  
  14.   Fraction *frac1 = [[Fraction alloc] init];
  15.   Fraction *frac2 = [[Fraction al
See the complete snippet
Language: Objective-C
Tags:
Submitted By: durul
Fraction.h - Snippet icon Fraction.h
  1. //
  2. // Fraction.h
  3. // 2-Fraction2c
  4. //
  5. // Created by durul on 10.11.2012.
  6. //
  7. //
  8.  
  9. #import <Foundation/Foundation.h>
  10.  
  11. @interface Fraction : NSObject
  12. {
  13. int numerator;
  14. int denominator;
  15. }
  16.  
  17. -(void) print;
  18. -(int) numerator;
  19. -(int) denominator;
  20. -(void) setNumerator: (int) n;
  21. -(void) setDenominator: (int) d;
  22. -(double) convert;
  23.  
  24. @end
  25.  
  26.  
See the complete snippet
Language: C
Tags:
Submitted By: durul
Code Collector Pro Header Image

Get Better Link Tester

Better Link Tester is the best way to check every page on your site to make sure that there are no broken links (404s), and to make sure that you site is up and running.

Find out more » Download Better Link Tester

Web Analytics