Skip to content

Instantly share code, notes, and snippets.

View skylee91's full-sized avatar

Sky Lee skylee91

  • Singapore
View GitHub Profile
@skylee91
skylee91 / ResolveUrl_ResolveClientUrl.cs
Created December 31, 2019 01:06
ResolveUrl vs ResolveClientUrl
//ResolveUrl creates the URL relative to the root.
//ResolveClientUrl creates the URL relative to the current page.
//Source: https://stackoverflow.com/questions/1874636/what-is-the-difference-between-resolveurl-and-resolveclienturl
//Returns: ../HomePage.aspx
String ClientURL = ResolveClientUrl("~/HomePage.aspx");
//Returns: /HomePage.aspx
String RegURL = ResolveUrl("~/HomePage.aspx");
@skylee91
skylee91 / HttpContext.Current.Request.Url
Created December 11, 2019 00:59
.NET HttpContext.Current.Request.Url
HttpContext.Current.Request.Url
.OriginalString
.AbsoluteUri
http://localhost:53788/Report/pgMeetingStatistics.aspx?vw=i
.Scheme
http
.Host
localhost
@skylee91
skylee91 / grunt-hugo-lunrjs.md
Created July 1, 2018 16:41 — forked from sebz/grunt-hugo-lunrjs.md
hugo + gruntjs + lunrjs = <3 search
@skylee91
skylee91 / DictionaryJsonConverter
Created December 12, 2017 07:50 — forked from petermorlion/DictionaryJsonConverter
Generic JsonConverter for JSON.NET and IDictionaries
// UPDATE!
// In Json.NET 7, a DictionaryKeyResolver was added.
// This might be able to fix the problem more elegantly.
// I haven't checked though.
public class DictionaryJsonConverter : JsonConverter
{
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
var dictionary = (IDictionary)value;
@skylee91
skylee91 / ActivityA.java
Created October 22, 2015 04:55
Camare Gallery in single Intent
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent)
{
super.onActivityResult(requestCode, resultCode, intent);
if (resultCode == Utils.CODE_ACTY_SCANQR)
{
String result = intent.getStringExtra("result");
Utils.DisplayToast(this, result);
@skylee91
skylee91 / README.md
Created October 1, 2015 11:20 — forked from polbins/README.md
Simple RecyclerView Divider

Simple RecyclerView Divider

Simple Horizontal Divider Item Decoration for RecyclerView

    mRecyclerView.addItemDecoration(new SimpleDividerItemDecoration(
            getApplicationContext()
    	));

NOTE: Add item decoration prior to setting the adapter

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.Canvas;
@skylee91
skylee91 / ImagePicker.java
Created September 25, 2015 05:54 — forked from Mariovc/ ImagePicker.java
Utility for picking an image from Gallery/Camera with Android Intents
/**
* Author: Mario Velasco Casquero
* Date: 08/09/2015
* Email: m3ario@gmail.com
*/
public class ImagePicker {
private static final int DEFAULT_MIN_WIDTH_QUALITY = 400; // min pixels
private static final String TAG = "ImagePicker";