- This is a collection of android snippets
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
<html> | |
<head> | |
<title>JavaScript - Set Homepage</title> | |
</head> | |
<body> | |
<input type="button" value="Set homepage" onclick="setHomepage('http://www.google.com');" /> | |
<script language="javascript"> | |
function setHomepage(url) { | |
if (document.all) { | |
document.body.style.behavior='url(#default#homepage)'; |
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
<html> | |
<head> | |
<title>JavaScript - Xml Http Request</title> | |
</head> | |
<body> | |
<input type="button" value="Xml Http Request" onclick="requestFile();" /> | |
<script language="javascript"> | |
// Source: http://www.webdeveloper.com/forum/showthread.php?t=147342 | |
function requestFile(){ |
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 setHomepage(url) { | |
if (document.all) { | |
document.body.style.behavior='url(#default#homepage)'; | |
document.body.setHomePage(url); | |
} else if (window.sidebar) { | |
if (window.netscape) { | |
try { | |
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); | |
} catch(e) { | |
alert("Cannot set homepage deu to browser permissions. Enter website manually or if you wish to enable this functionality, enter about:config in your address bar and change the value of signed.applets.codebase_principal_support to 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
/* JavaScript to determine browser mode */ | |
function getEngine(){ | |
var _eng; | |
if(window.navigator.appName=="Microsoft Internet Explorer"){ // This is an IE browser. What mode is the engine in? | |
if(document.documentMode){ // IE8 or later | |
_eng = document.documentMode; | |
} else { // IE 5-7 | |
_eng = 5; // Assume quirks mode unless proven otherwise | |
if(document.compatMode){ | |
if(document.compatMode == "CSS1Compat") { |
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
<html> | |
<head> | |
<title>JavaScript - Add to favourites</title> | |
</head> | |
<body> | |
<input type="button" value="Add to favourites" onclick="addToFavorites('Google','http://www.google.com');" /> | |
<script language="javascript"> | |
function addToFavorites(name,url) { | |
if(window.external){ // ie | |
window.external.AddFavorite(url,name) |
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
/* | |
* jQuery scrollbarTable - v0.1 - 5/6/2011 | |
* Derek Bredensteiner | |
* Licensed under the MIT license http://www.opensource.org/licenses/mit-license.php | |
*/ | |
(function($){ | |
$.fn.scrollbarTable = function(i){ | |
var o = {}; | |
if(typeof(i)=='number')o.height=i; | |
else if(typeof(o)=='object') o = i; |
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
<script src="http://widgets.twimg.com/j/2/widget.js"></script> | |
<script> | |
new TWTR.Widget({ | |
version: 2, | |
type: 'profile', | |
rpp: 4, | |
interval: 30000, | |
width: 250, | |
height: 300, | |
theme: { |
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
package com.example.testSingleton; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.widget.Toast; | |
public class ActivityA extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- google's material design colours from | |
http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
<!--reds--> | |
<color name="md_red_50">#fde0dc</color> | |
<color name="md_red_100">#f9bdbb</color> | |
<color name="md_red_200">#f69988</color> |
OlderNewer