Skip to content

Instantly share code, notes, and snippets.

@wplab
wplab / simple-jquery.js
Created October 2, 2019 13:30 — forked from frontdevops/simple-jquery.js
Short jQuery implementation on ES7+
const $ = ::document.querySelectorAll;
{
let p = Element.prototype;
p.on = Element.prototype.addEventListener;
p.find = function(s){ return this.querySelector(s) };
p.html = function(s){
if(!s) return this.innerHTML;
this.innerHTML = s;
return this;
};
notifyMe =()=> {
if (!window.Notification) {
console.log('Browser does not support notifications.');
} else {
// check if permission is already granted
if (Notification.permission === 'granted') {
// show notification here
const notify = new Notification('Hi there!', {
body: 'How are you doing?',
icon: 'https://bit.ly/2DYqRrh',
@wplab
wplab / sendy.php
Created July 23, 2018 09:50 — forked from Pross/sendy.php
Add to mu-plugins folder, auto add every new user to a sendy list. Works with default WordPress and Woocommerce registrations.
<?php
add_action( 'user_register', 'add_user_to_sendy_list' );
function add_user_to_sendy_list( $user_id ) {
$list = 'SENDY_LIST_ID';
$url = 'http://SENDY_INSTALL_URL/subscribe';
$user = get_userdata( $user_id );
$email = $user->data->user_email;
$name = $user->data->user_nicename;

Keybase proof

I hereby claim:

  • I am wplab on github.
  • I am wplab (https://keybase.io/wplab) on keybase.
  • I have a public key ASCVVbb5EEfTz1iAfK3JqgoH9BjeGsSwrd7MrdZFuGxmGAo

To claim this, I am signing this object: