Skip to content

Instantly share code, notes, and snippets.

View drxyzw's full-sized avatar

drxyzw

  • Singapore
View GitHub Profile
@wnarifin
wnarifin / covid_19_malaysia_webscraping.md
Last active February 7, 2021 12:58
Scraping data on Covid-19 in Malaysia from DG of Health daily press release

About

I find it tedious to manually update and maintain Excel files of Covid-19 situation in Malaysia. The Director General of Health releases daily press statement in the website, in text format (only some info in Table): https://kpkesihatan.com/

For data analysis, data in structured format is prefered, but this is not readily available from the source. Thus, the data must be updated manually everyday from the website or by listening to the press conference.

In this Gist, I share a method to scrape data from the web page of the daily update in R.

You may also have a look at my scraped data sets and updated scripts at https://github.com/wnarifin/covid-19-malaysia.

Required packages

@strangerstudios
strangerstudios / gist:2185226
Last active April 16, 2021 01:15
Delete the WordPress User When a Paid Memberships Pro Member Cancels His Account
/*
Requires PMPro v1.4+
Code to delete WP user accounts when a member cancels their PMPro account.
Users are not deleted if:
(1) They are not cancelling their membership (i.e. $level_id != 0)
(2) They are an admin.
(3) The level change was initiated from the WP Admin Dashboard
(e.g. when an admin changes a user's level via the edit user's page)
*/
function my_pmpro_after_change_membership_level($level_id, $user_id)