How to implement a custom search for Hugo usig Gruntjs and Lunrjs.
Install the following tools:
| //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"); |
| HttpContext.Current.Request.Url | |
| .OriginalString | |
| .AbsoluteUri | |
| http://localhost:53788/Report/pgMeetingStatistics.aspx?vw=i | |
| .Scheme | |
| http | |
| .Host | |
| localhost |
| // 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; |
| @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); |
| 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; |
| /** | |
| * 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"; |