- This is a collection of android snippets
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
| Get-ChildItem -Recurse . | where { $_.PSISContainer -and @( $_ | Get-ChildItem ).Count -eq 0 } | Remove-Item -force |
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
| /* | |
| * Copyright 2014 Chris Banes | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
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
| <?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> |
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.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 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
| <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 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
| /* | |
| * 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 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
| <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 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
| /* 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 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
| 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"); |