Skip to content

Instantly share code, notes, and snippets.

View longzheng's full-sized avatar

Long Zheng longzheng

  • Melbourne, Australia
  • 23:31 (UTC +11:00)
  • X @longzheng
View GitHub Profile
var fpdefs = {
vertex_shader :
'attribute vec3 a_vertexPosition,a_vertexNormal;attribute vec2 a_vert' +
'exTexture;uniform mat4 u_mvMatrix,u_pMatrix,u_nMatrix;uniform vec3 u' +
'_lightPosition;varying vec3 v_normal;varying vec2 v_texture;varying ' +
'vec3 v_eyeVec,v_lightRay;void main(){vec4 vertex=u_mvMatrix*vec4(a_v' +
'ertexPosition,1.);v_normal=vec3(u_nMatrix*vec4(a_vertexNormal,1.));v' +
'ec4 light=u_mvMatrix*vec4(u_lightPosition,1.);v_lightRay=vertex.rgb-' +
'light.rgb;v_eyeVec=-vec3(vertex.rgb);gl_Position=u_pMatrix*vertex;gl' +
'_PointSize=1.;v_texture=a_vertexTexture*3.-vec2(1.,1.);}',
window.JdVx = !!window.JdVx;
try {
(function() {
(function() {}
)();
var Ii = 79;
try {
var Li, Oi, si = J(125) ? 1 : 0, Si = J(90) ? 1 : 0, iI = J(184) ? 1 : 0, II = J(206) ? 1 : 0, jI = J(445) ? 1 : 0, Jl = J(214) ? 1 : 0, ll = J(585) ? 1 : 0;
for (var zI = (J(557),
0); zI < Oi; ++zI)
[{
"outlet_distance": 27.8058357,
"outlet_slid_spid": "968",
"outlet_name": "Shop 2, 1-5 Elizabeth Street",
"outlet_business": "7-Eleven Flinders Street",
"outlet_latitude": -37.8180466,
"outlet_longitude": 144.964737,
"outlet_suburb": "Melbourne",
"outlet_postcode": 3000,
"outlet_business_hour_mon": "24 Hours",
@longzheng
longzheng / gist:6b6746db0b72500bc0f8512869d0b3a6
Last active March 9, 2018 00:49
Userscript to run speedtest.net at interval
// ==UserScript==
// @name Run speedtest.net at interval
// @namespace http://tampermonkey.net/
// @version 0.2
// @description N/A
// @match http*://www.speedtest.net/*
// @author Long Zheng
// ==/UserScript==
(function() {
Suburb: Springvale
POI: 3WHL
ADA: 3SPL-65
12:03pm – 8ms – 94.80mbps / 37.86mbps http://beta.speedtest.net/result/6318518306
3:40pm – 8ms – 92.88mbps / 37.70mbps http://beta.speedtest.net/result/6318832230
5:07pm – 8ms – 93.35mbps / 37.84mbps http://beta.speedtest.net/result/6318970846
6:52pm – 8ms – 92.41mbps / 36.69mbps http://beta.speedtest.net/result/6319163456
7:36pm – 9ms – 90.93mbps / 37.11mbps http://beta.speedtest.net/result/6319245894
7:57pm – 9ms – 92.00mbps / 37.34mbps http://beta.speedtest.net/result/6319283600
<!doctype html>
<html lang="en">
<head prefix="og: http://ogp.me/ns# video: http://ogp.me/ns/video#">
<meta charset="utf-8">
<title>Arrival of a Train at La Ciotat</title>
<meta property="og:title" content="Arrival of a Train at La Ciotat">
<meta property="og:description" content="L'arrivée d'un train en gare de La Ciotat is an 1895 French short black-and-white silent documentary film directed and produced by Auguste and Louis Lumière. Its first public showing took place in January 1896.">
<meta property="og:site_name" content="Open Graph protocol examples">
<meta property="og:type" content="video.movie">
<meta property="og:locale" content="en_US">
@longzheng
longzheng / gist:5804979
Last active December 18, 2015 15:29
Google Docs TV
<!DOCTYPE html>
<html>
<head>
<title>TV</title>
<style>
html, body {
background: black;
padding: 0;
margin: 0;
width: 100%;
@longzheng
longzheng / gist:3385100
Created August 18, 2012 07:46
Windows 8 RTM StandardStyles
<!--
This file contains XAML styles that simplify application development.
These are not merely convenient, but are required by most Visual Studio project and item templates.
Removing, renaming, or otherwise modifying the content of these files may result in a project that
does not build, or that will not build once additional pages are added. If variations on these
styles are desired it is recommended that you copy the content under a new name and modify your
private copy.
-->
@longzheng
longzheng / gist:2308859
Last active December 8, 2017 05:09
Windows 8.1 default XAML templates and styles
<!--
//
// Copyright (c) Microsoft Corporation. All Rights Reserved.
//
-->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.ThemeDictionaries>
@longzheng
longzheng / gist:1513173
Created December 23, 2011 04:48
Difference in regex quantifiers parsing of JAVA and .NET
So I discovered this interesting difference in how JAVA and .NET parses Regex quantifiers by throwing myself against a brick wall (Twitter's regex library https://github.com/twitter/twitter-text-java/blob/master/src/com/twitter/Regex.java)
In JAVA, if you do
[[a-z]\-]*
It would actually match zero or more of "a-z" AND "-". It seems to automatically include everything inside any child square brackets.
In .NET,
[[a-z]\-]*
Only matches zero or more of "-". Just one of [a-z]