Skip to content

Instantly share code, notes, and snippets.

View diegoliv's full-sized avatar

Diego de Oliveira diegoliv

View GitHub Profile
@Shelob9
Shelob9 / block.js
Last active January 16, 2018 09:07
Example WordPress block using VueJs, just to prove it works to Zac. Would be better to use https://github.com/alkin/vue-react or https://github.com/SmallComfort/react-vue
( function( wp ) {
var el = wp.element.createElement;
var __ = wp.i18n.__;
wp.blocks.registerBlockType( 'vuetest/vuetest', {
title: __( 'Vue Test', 'vuetest' ),
category: 'widgets',
supportHTML: false,
attributes: {
hi: {
@cou929
cou929 / detect-private-browsing.js
Last active May 1, 2024 21:07
Detect private browsing mode (InPrivate Browsing or Incognito).
function retry(isDone, next) {
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false;
var id = window.setInterval(
function() {
if (isDone()) {
window.clearInterval(id);
next(is_timeout);
}
if (current_trial++ > max_retry) {
window.clearInterval(id);