This file contains hidden or 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
| // Creating a new Item | |
| PlaylistItem pi = new PlaylistItem(mContext); | |
| pi.title = "Discophrenia" | |
| pi.desc = "This is a rather long description" | |
| pi.author = "Brad Slyde" | |
| if(pi.save){ | |
| // Saved successfully | |
| } | |
| else { |
This file contains hidden or 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
| date = Date.new(2007, 11, 10) # => Sat, 10 Nov 2007 | |
| date.to_formatted_s(:db) # => "2007-11-10" | |
| date.to_s(:db) # => "2007-11-10" | |
| date.to_formatted_s(:short) # => "10 Nov" | |
| date.to_formatted_s(:long) # => "November 10, 2007" | |
| date.to_formatted_s(:long_ordinal) # => "November 10th, 2007" | |
| date.to_formatted_s(:rfc822) # => "10 Nov 2007" | |
This file contains hidden or 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
| <VirtualHost *:80> | |
| ServerName www.yourhost.com | |
| # be sure to point to 'public'! | |
| DocumentRoot /somewhere/public | |
| <Directory /somewhere/public> | |
| # relax Apache security settings | |
| # This step can achieved in a number of different steps | |
| AllowOverride all | |
| # MultiViews must be turned off | |
| Options -MultiViews |
This file contains hidden or 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
| package com.swan.helloworld; | |
| import android.app.Activity; | |
| import android.os.Bundle; | |
| public class MainActivity extends Activity { | |
| /** Called when the activity is first created. */ | |
| @Override | |
| public void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); |
This file contains hidden or 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
| <?php | |
| // These following lines load the project context | |
| require_once(dirname(__FILE__).'/config/ProjectConfiguration.class.php'); | |
| // I use 'prod' all the time, and 'dev' only when something goes wrong | |
| $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'prod', false); | |
| // Generally keep 'dev', I use 'prod' all the time, 'dev' only when something goes wrong | |
| // If you want to test just the models and business logic: | |
| // sfContext::createInstance($configuration); | |
| // If you want to test URL helpers and other helpers that require controller context | |
| sfContext::createInstance($configuration)->dispatch(); |
This file contains hidden or 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
| <?php | |
| /* | |
| Credit Card Validator | |
| Date - Sep 04, 2009 | |
| Author - Brent Shaffer | |
| ABOUT |
This file contains hidden or 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
| >> wall "Changing the mysql root password, please bear. -Swanand" | |
| Broadcast message from root (pts/3) (Sat Nov 21 12:53:50 2009): | |
| Changing the mysql root password, please bear. Thanks, Swanand | |
| >> wall "Done. Thanks for the patience. -Swanand" | |
| Broadcast message from root (pts/3) (Sat Nov 21 12:54:44 2009): | |
| Done. Thanks for the patience. -Swanand |
This file contains hidden or 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
| >> Bitly.shorten "http://www.facebook.com/home.php" | |
| => "http://bit.ly/3B2w14" | |
| >> Bitly.shorten "http://bit.ly/" | |
| => "http://bit.ly/" |
This file contains hidden or 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
| # To change this template, choose Tools | Templates | |
| # and open the template in the editor. | |
| class Bitly < ActiveResource::Base | |
| self.site = 'http://api.bit.ly' | |
| self.user = 'USERNAME' | |
| self.password = 'PASSWORD' | |
| cattr_accessor :login, :return_format, :api_key, :bitly_version |
This file contains hidden or 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
| class Array | |
| def to_sentence(options = {}) | |
| # en-US: "One, Two, and Three" en-UK: "One, Two and Three" | |
| options[:last_word_connector] ||= " and " | |
| super | |
| end | |
| end | |
NewerOlder