Skip to content

Instantly share code, notes, and snippets.


Wanlin Lin WanLinLin

  • Snapask
  • Taipei, Taiwan
View GitHub Profile
WanLinLin / google-ad-manager-ad-unit.jsx
Last active Jul 5, 2020
Google Ad Manager Ad Unit React Component
View google-ad-manager-ad-unit.jsx
import React from 'react'
import PropTypes from 'prop-types'
* It's used to generate ad element id. Make sure:
* - only increment it ONCE per component
* - only modify it on browser, not on server side
WanLinLin / index.html
Last active Jul 5, 2020
Recaptcha React Component
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>React Recaptcha Example</title>
function onRecaptchaLoaded() {
WanLinLin /
Created Jun 20, 2019
Merge query to url (python 2.7.13)
import urlparse
def merge_query_to_url(url, query):
"""Merge query into url without any url encode/decode."""
url_parts = urlparse.urlparse(url)
# convert existing query string to dict
# Not using `urlparse.parse_qs` to extract existing query from url because
# it will convert url's query to utf8 string if it's url encoded