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 | |
$data = (object)array( | |
"html" => "<foo bar=\"baz\"/> &", | |
"arabic" => "العربية al-ʿarabiyyah, IPA: [æl ʕɑrɑˈbijjɐ], or عربي ʿarabī", | |
"hebrew" => "עִבְרִית, Ivrit", | |
"chinese" => "汉语/漢語 Hanyu; 华语/華語 Huáyǔ; 中文 Zhōngwén", | |
"korean" => "한국어/조선말", | |
"japanese" => "日本語 Nihongo", | |
"umlauts" => "äüöãáàß", |
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 | |
/*************************************************************** | |
Description: City data in JSON. | |
Developer: Vishal Kurup | |
***************************************************************/ | |
$host = "abc12345"; //Your database host server | |
$db = "abc12345"; //Your database name | |
$user = "abc12345"; //Your database user |
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
-- create table | |
CREATE TABLE cities | |
( | |
id INT PRIMARY KEY NOT NULL auto_increment, | |
cityName VARCHAR(255), | |
cityState VARCHAR(255), | |
cityPopulation int, | |
country VARCHAR(255) | |
); |
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 Json { | |
public static JSONObject getJson(String url){ | |
InputStream is = null; | |
String result = ""; | |
JSONObject jsonObject = null; | |
// HTTP | |
try { |
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
int currentapiVersion = android.os.Build.VERSION.SDK_INT; | |
if (currentapiVersion >= android.os.Build.VERSION_CODES.FROYO){ | |
// Do something for froyo and above versions | |
} else{ | |
// do something for phones running an SDK before froyo | |
} |
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 | |
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); | |
switch ($lang){ | |
case "fr": | |
//echo "PAGE FR"; | |
include("index_fr.php");//include check session FR | |
break; | |
case "it": | |
//echo "PAGE IT"; | |
include("index_it.php"); |
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
$('.navbar a.navbar-link').click(function() { | |
var navbar_toggle = $('.navbar-toggle'); | |
if (navbar_toggle.is(':visible')) { | |
navbar_toggle.trigger('click'); | |
} | |
}); |
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
.group { | |
zoom: 1; | |
&:before, | |
&:after { | |
content: ''; | |
display: table; | |
} | |
&:after { | |
clear: both; | |
} |
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
#define kDefaultFontSize 24.0 | |
myTextView.text = @"Some long string that will be in the UITextView"; | |
myTextView.font = [UIFont systemFontOfSize:kDefaultFontSize]; | |
//setup text resizing check here | |
if (myTextView.contentSize.height > myTextView.frame.size.height) { | |
int fontIncrement = 1; | |
while (myTextView.contentSize.height > myTextView.frame.size.height) { | |
myTextView.font = [UIFont systemFontOfSize:kDefaultFontSize-fontIncrement]; |
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
textView.text = @"some text"; | |
CGRect rect = textView.frame; | |
rect.size.height = textView.contentSize.height; | |
textView.frame = rect; |