Skip to content

Instantly share code, notes, and snippets.

View pokk's full-sized avatar
🌀

Jieyi pokk

🌀
View GitHub Profile
@pokk
pokk / README.md
Last active April 5, 2017 02:16
effective heapq

Introduction

If you want to use the min() or max() function in python. There is that an alternative way of the speedy method is headq.

benifits

The time complexity for finding a max value and a min value is O(logn).
Time complexity of min() and max() are O(n).

Talk is cheap. Show me the code.

@pokk
pokk / README.md
Created October 28, 2016 15:03
create a dialog fragment in iOS Xamarin

Introduction

Create a simple dialog toast in iOS by Xamarin.

@pokk
pokk / README.md
Created October 29, 2016 03:16
create a gif animation in iOS

Introduction

Create a gif animation in iOS.

@pokk
pokk / README.md
Last active April 5, 2017 02:15
In python align the string

Introduction

If you don't feel '\t' is convenient, you could customize the free space how many you want.

Talk is cheap. Show me the code.

# Align right
s = 'test'.rjust(10)
# >>> "test "
@pokk
pokk / MyActivity.java
Last active January 11, 2017 06:23
Create a intent to open other intent
public class MyActivity extends Activity {
public static final int INPUT_FILE_REQUEST_CODE = 5568;
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (RESULT_OK == resultCode) {
switch (requestCode) {
case INPUT_FILE_REQUEST_CODE:
@pokk
pokk / README.md
Last active April 5, 2017 02:39
Implement the broadcast & receiver and local of both.

[TOC]

Introduction

  1. Broadcast & Receiver
  2. LocalBroadcast & LocalReceiver

Broadcast & Receiver

@pokk
pokk / README.md
Last active November 15, 2016 08:18
Implement a web application in Android.

Introduction

When develope the web app in Android, you have to customize all of the function by yourself; otherwise, they don't work.

  1. WebViewClient
  2. WebChromeClient
  3. DownloadListener

We should implement three classes for handling various actions you need.

@pokk
pokk / README.md
Created November 18, 2016 00:56
Obtain http header information.

Introduction

We can obtain all of the HTTP header information from WKWebView.

@pokk
pokk / README.md
Last active December 16, 2016 07:28
change URL request or set an action in WebViewClient

Introduction

Changing the default action before loading a url link.

@pokk
pokk / README.md
Last active December 16, 2016 07:44
Add the user agent in your WKWebView.

Introduction

Add the user agent in your WKWebView.