Skip to content

Instantly share code, notes, and snippets.

Get-ChildItem -Recurse . | where { $_.PSISContainer -and @( $_ | Get-ChildItem ).Count -eq 0 } | Remove-Item -force
/*
* 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
<?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>
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) {
@fuhoi
fuhoi / android snippets.md
Last active July 13, 2023 14:46
Android Snippets

ANDROID SNIPPETS

  • This is a collection of android snippets
@fuhoi
fuhoi / html-twitter-widget
Created December 22, 2011 04:06
Twitter Widget
<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: {
/*
* 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;
@fuhoi
fuhoi / gist:1050557
Created June 28, 2011 05:32
html-add-to-favourites
<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)
@fuhoi
fuhoi / gist:1050495
Created June 28, 2011 04:29
javascript-ie-mode
/* 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") {
@fuhoi
fuhoi / gist:1050486
Created June 28, 2011 04:24
javascript-set-homepage
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");