This file contains 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
Titanium.UI.setBackgroundColor('red'); | |
// root | |
var rootWin = Ti.UI.createWindow({ | |
title: 'Root Win', | |
backgroundColor: 'gray', | |
tabBarHidden: true, | |
navBarHidden: true | |
}); |
This file contains 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 | |
/* Updated match function */ | |
function match ($rule) { | |
extract($rule); | |
switch($property) { | |
case 'Any item name': $subject = $this->name; break; | |
case 'Any item quantity': $subject = (int)$this->quantity; break; | |
case 'Any item amount': $subject = $this->total; break; | |
This file contains 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
-- EXAMPLE QUERY FOR USER'S primary address: | |
SELECT A.address1, A.address2, A.city, A.state, A.zip FROM users U | |
LEFT JOIN users_addresses UA ON U.id = A.user | |
LEFT JOIN address A ON UA.address = A.id | |
WHERE UA.primary = 1 AND UA.deleted = 0; | |
-- ADDRESS | |
CREATE TABLE IF NOT EXISTS `addresses` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`address1` varchar(225) NOT NULL, |
This file contains 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
add_action('admin_menu', 'hook_uniquePostTypes'); | |
function hook_uniquePostTypes(){ | |
global $submenu, $menu; | |
// post types to make singular | |
$postTypes = array('example1', 'example2'); | |
foreach($submenu as $key=>$value){ | |
$name = preg_replace('/edit.php\?post_type\=/', '', $key); | |
foreach($postTypes as $type){ |
This file contains 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
import javax.swing.JOptionPane; | |
public class Salary1 { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
//define the variables for the input box |
This file contains 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
<h1>Shopping Cart</h1> | |
{% if cart.item_count > 0 %} | |
<form action="/cart" method="post"> | |
<table> | |
<thead> | |
<tr> |
This file contains 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 | |
function card_month_options(){ | |
$months = array('01','02','03','04','05','06','07','08','09','10','11','12'); | |
foreach ($months as $month): ?> | |
<option value="<?php echo $month; ?>"><?php echo $month; ?></option> | |
<?php endforeach; |
This file contains 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 get_header(); ?> | |
<div id="main-content"> | |
<h2><?php the_title(); ?></h2> | |
<p><?php the_content(); ?></p> | |
</div> | |
<div id="sidebar"> | |
First sidebar: | |
<?php get_sidebar(); ?> |
This file contains 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
public class Person | |
{ | |
private Head head; | |
private Torsoe torsoe; | |
private Arm leftArm; | |
private Arm rightArm; | |
private Leg leftLeg; | |
private Leg rightLeg; | |
} |
This file contains 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
(function () { | |
"use strict"; | |
console.log("Today", new Date().getDay()); | |
function daysBetween(date1, date2) { | |
return (date1 - date2) / (1000 * 60 * 60 * 24); | |
} |
OlderNewer