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;
@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 / sonarqube-docker-compose.yml
Created July 18, 2020 11:42 — forked from Warchant/sonarqube-docker-compose.yml
docker-compose file to setup production-ready sonarqube
version: "3"
services:
sonarqube:
image: sonarqube
expose:
- 9000
ports:
- "127.0.0.1:9000:9000"
networks:
@hisetu
hisetu / Dockerfile
Created September 4, 2020 04:06 — forked from atsushieno/Dockerfile
fluidsynth for Android docker build
FROM bitriseio/android-ndk
WORKDIR /usr/local/src
ENV ANDROID_NDK_PATH /opt/android-ndk
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
@hisetu
hisetu / gist:1043b00d84bcfd7525e14cafe76e16bb
Created November 13, 2020 10:16 — forked from RikkaW/gist:0ae7f51117768a03c6581c956d75958c
insert general file with MediaStore
Context context = view.getContext();
ContentResolver cr = context.getContentResolver();
ContentValues values;
try {
// create a file for test
File file = new File(context.getFilesDir(), "1234568");
file.createNewFile();
try (OutputStream os = new FileOutputStream(file)) {
os.write("test".getBytes());
@hisetu
hisetu / GridSpacingItemDecoration.md
Created May 11, 2021 03:28 — forked from cxyxlxdm/GridSpacingItemDecoration.md
Add column spacing in RecyclerView with GridLayoutManager

Android Recyclerview GridLayoutManager column spacing Here is the question, the first answer does not work well in my project,and it makes the spacing bigger between item and item. the second answer is quite perfect.But if RecyclerView has headers,it does not work well. Then I fixed it.

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**