Skip to content

Instantly share code, notes, and snippets.

View normanzb's full-sized avatar
🛵
stay safe

Norm X normanzb

🛵
stay safe
  • Somewhere decentralised
  • London
View GitHub Profile
@normanzb
normanzb / gist:ee8ffede036a6c63a655
Created April 21, 2015 14:39
new cookie clearing script
<script>
(function() {
function setCookie(name, value, days) {
var expires;
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toGMTString();
@normanzb
normanzb / search-path-memory-consumption.js
Created March 10, 2015 16:20
CQ5 client-side author mode memory consumption workaround
define(function(){
'use strict';
var patched = false;
var calculateSearchPathsBackup;
var getStyleEntryBackup;
var g = this;
function calculateSearchPathsHack() {
this.names = [];
javascript:%28function%28%29%7Bfunction callback%28%29%7Bb2cDebuglet%28%29%7Dvar s%3Ddocument.createElement%28"script"%29%3Bs.id%3D"b2cDebuglet"%3Bs.src%3D"/etc/designs/b2c/clientlibs-generic/debuglet/b2cDebuglet.js"%3Bif%28s.addEventListener%29%7Bs.addEventListener%28"load"%2Ccallback%2Cfalse%29%7Delse if%28s.readyState%29%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild%28s%29%3B%7D%29%28%29
;(function(){
"use strict";
var Timed = window.qubit.opentag.Timed;
var Utils = window.qubit.opentag.Utils;
var Container = window.qubit.opentag.Container;
function ExecutionContext(firedTagsMap, command, forceAsync) {
this.firedTagsMap = firedTagsMap;
this.command = command;
@normanzb
normanzb / README.md
Last active August 29, 2015 14:14
Norm's p.r.o.x.y

You can connect to norm's p.r.o.x.y by using below 3 methods:

PPTP

Server: norm.im

Shadowsock

@normanzb
normanzb / gist:137a8b9d0cf317a1be58
Created December 11, 2014 13:49
IE8 onpropertychange doesn't fire
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<input id="test" />
<script type="text/javascript">
(function(){
var count = 0;
@normanzb
normanzb / study-plan.html
Created August 11, 2014 18:11
study-plan.html
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta content="yes" name="apple-touch-fullscreen">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
@normanzb
normanzb / study-plan-rtl.html
Created August 11, 2014 18:03
study-plan-rtl
<!DOCTYPE html>
<html lang="en" dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta content="yes" name="apple-touch-fullscreen">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<!doctype html>
<html>
<head>
<title>iFrame memory leak prevention test</title>
</head>
<body>
<h1>iFrame memory leak prevention test (void)</h1>
<p>In IE up through version 8 adding an iframe to a page and
removing it produces a memory leak in some cases. The pattern
@normanzb
normanzb / study-plan-rtl.html
Last active August 29, 2015 14:04
study plan rtl
<!DOCTYPE html>
<html lang="en" dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta content="yes" name="apple-touch-fullscreen">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">