Skip to content

Instantly share code, notes, and snippets.

@hisetu
hisetu / gist:1100b3d540bc70b041d16a5902c4d9a6
Created April 12, 2016 13:09 — forked from timonweb/gist:3165322
Code to catch all PHP errors which result in 500 Error Code. Include this snippet at the beginning of index.php file
<?php
define('E_FATAL', E_ERROR | E_USER_ERROR | E_PARSE | E_CORE_ERROR |
E_COMPILE_ERROR | E_RECOVERABLE_ERROR);
define('ENV', 'dev');
//Custom error handling vars
define('DISPLAY_ERRORS', TRUE);
define('ERROR_REPORTING', E_ALL | E_STRICT);
@hisetu
hisetu / 1MarkerAnimation.java
Created April 16, 2016 03:52 — forked from broady/1MarkerAnimation.java
Animating Markers
/* Copyright 2013 Google Inc.
Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0.html */
package com.example.latlnginterpolation;
import android.animation.ObjectAnimator;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.os.Build;
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
public class ${NAME}{
private static volatile ${NAME} INSTANCE;
public static ${NAME} getInstance() {
if (INSTANCE == null) {
synchronized (${NAME}.class) {
if (INSTANCE == null) {
INSTANCE = new ${NAME}();
@hisetu
hisetu / xamarinandroidbindings.md
Created July 17, 2017 06:31 — forked from JonDouglas/xamarinandroidbindings.md
Xamarin Android Bindings Troubleshooting

Approaching a Xamarin.Android Bindings Case

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Binding is to first ensure you have the proper tooling available:

using System.Threading.Tasks;
using Newtonsoft.Json;
using Refit;
using System.Net.Http;
using System;
namespace wms_xamarin
{
public class LoginApi
{
@hisetu
hisetu / xampp_php7_xdebug.md
Created September 24, 2017 06:12 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP
@hisetu
hisetu / TransactionScopeRollbackDemo.cs
Created April 25, 2018 01:05 — forked from royosherove/TransactionScopeRollbackDemo.cs
Using TransactionScope to rollback database changes in tests
[TestFixture]
public class TrannsactionScopeTests
{
private TransactionScope trans = null;
[SetUp]
public void SetUp()
{
trans = new TransactionScope(TransactionScopeOption.Required);
}
[TearDown]
@hisetu
hisetu / android_emulator.bat
Last active August 21, 2019 02:34
Start Android emulator by command
CALL %LOCALAPPDATA%\Android\sdk\emulator\emulator.exe -list-avds
@ECHO off
SET /P name=Enter Emulator Name:
CALL %LOCALAPPDATA%\Android\sdk\emulator\emulator.exe @%name%
PAUSE
@hisetu
hisetu / gist:4a19742a4221c3eeb93a37b5a223cf60
Created October 14, 2019 03:31
list third-party package
List<ApplicationInfo> apps = getPackageManager().getInstalledApplications(0);
for (int i=0; i < apps.size(); i++)
{
if ((apps.get(i).flags & ApplicationInfo.FLAG_SYSTEM) != 1)
{
//System app
}
}
@hisetu
hisetu / Android WebView
Created March 21, 2020 09:49
Android WebView
AOSP 的 WebView 預設使用com.android.webview
安裝Android System WebView (com.google.android.webview)
執行 App 使用的 WebView 元件仍是com.android.webview