Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<body>
<div id="container"></div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.7.0/pixi.js"></script>
<script type="text/javascript">
var app = new PIXI.Application(800, 600, { transparent: true });
document.getElementById('container').appendChild(app.view);
<!DOCTYPE html>
<html>
<body>
<div id="container"></div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.7.0/pixi.js"></script>
<script type="text/javascript">
var app = new PIXI.Application(800, 600, { transparent: true });
document.getElementById('container').appendChild(app.view);
PIXI.loader
.add('required/assets/depth_blur_BG.jpg')
.add('required/assets/depth_blur_moby.jpg')
.load(main);
function main() {
var app = {
screen: {
width: 650,
height: 650,
[0106/110405.870165:ERROR:gpu_process_transport_factory.cc(1043)] Lost UI shared context.
DevTools listening on ws://127.0.0.1:35003/devtools/browser/0fa5a5a6-a323-4fa5-93f9-890819314009
Fontconfig warning: "/etc/fonts/fonts.conf", line 146: blank doesn't take any effect anymore. please remove it from your fonts.conf
[0106/110406.813320:INFO:gl_bindings_autogen_egl.cc(1370)] eglChooseConfig(0x1, 0x7ffcbbdc37b0, (nil), 0, 0x7ffcbbdc3754)
[0106/110406.813423:INFO:gl_bindings_autogen_egl.cc(1373)] GL_RESULT: 1
[0106/110406.813466:INFO:gl_bindings_autogen_egl.cc(1370)] eglChooseConfig(0x1, 0x7ffcbbdc37b0, 0x7ffcbbdc3748, 1, 0x7ffcbbdc3754)
[0106/110406.813499:INFO:gl_bindings_autogen_egl.cc(1373)] GL_RESULT: 1
[0106/110406.813519:INFO:gl_bindings_autogen_egl.cc(1448)] eglCreatePbufferSurface(0x1, 0x2e, 0x317febff860)
[0106/110406.813565:INFO:gl_bindings_autogen_egl.cc(1451)] GL_RESULT: 0x317fed1f700
[0104/105517.182758:VERBOSE1:histogram.cc(400)] Histogram: Blink.Canvas.DrawImage.Canvas.CPU has bad minimum: 0
[0104/105517.237338:VERBOSE1:gl_factory.cc(102)] Using egl GL implementation.
[0104/105517.237476:INFO:gl_bindings_autogen_egl.cc(1370)] eglChooseConfig(0x1, 0x7ffdd2eee570, (nil), 0, 0x7ffdd2eee514)
[0104/105517.237532:INFO:gl_bindings_autogen_egl.cc(1373)] GL_RESULT: 1
[0104/105517.237556:INFO:gl_bindings_autogen_egl.cc(1370)] eglChooseConfig(0x1, 0x7ffdd2eee570, 0x7ffdd2eee508, 1, 0x7ffdd2eee514)
[0104/105517.237583:INFO:gl_bindings_autogen_egl.cc(1373)] GL_RESULT: 1
[0104/105517.237604:INFO:gl_bindings_autogen_egl.cc(1448)] eglCreatePbufferSurface(0x1, 0x2e, 0x3889b34dcaa0)
[0104/105517.237646:INFO:gl_bindings_autogen_egl.cc(1451)] GL_RESULT: 0x3889b355d7a0
[0104/105517.237693:INFO:gl_bindings_autogen_egl.cc(1634)] eglGetConfigAttrib(0x1, 0x2e, 12352, 0x7ffdd2eed0d8)
[0104/105517.237720:INFO:gl_bindings_autogen_egl.cc(1637)] GL_RESULT: 1
<!DOCTYPE html>
<html>
<body>
<canvas id="canvas" width="1080" height="1080"></canvas>
<script type="text/javascript">
var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
gl.viewportWidth = canvas.width;
gl.viewportHeight = canvas.height;
@jhollingworth
jhollingworth / install-deps.sh
Last active January 4, 2018 13:42
Check X11
> sudo yum install libXext-devel libX11-devel xorg-x11-server-Xorg xorg-x11-server-Xvfb
> ls /usr/lib64 | grep X11
libX11.so
libX11.so.6
libX11.so.6.3.0
libX11-xcb.so
libX11-xcb.so.1
libX11-xcb.so.1.0.0
X11
@jhollingworth
jhollingworth / storage-sync.html
Created May 19, 2016 10:14
Local storage sync
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
console.log('hello world')
</script>
</head>
<body>
</body>
</html>
@jhollingworth
jhollingworth / profiles.md
Created December 15, 2015 14:59
profiles

#Why are profiles fast?

There's a lot of work that goes into determining what profiles you're in. People often ask if having a large number of profiles on the page will negatively affect performance. When designing profiles we're accutely aware of this problem and so have implemented a number of optimisations to ensure we're performant at scale.

To create a profile, you define a profile specification. Profile specifications are a lisp-esque langauge that allows you to define a predicate tree.

[
  "and",
 [
@jhollingworth
jhollingworth / marty-to-redux.md
Last active November 14, 2019 20:24
Translating Marty to Redux

#Translating Marty to Redux

Some people have asked how I've translated a Marty app to Redux. Once you get your head around how Redux works I found concepts in Marty translated easily. Below is side-by-side comparison of the two libraries to help you along the way.

Also if you're looking for some devtools, check out redux-devtools.

##Constants

Marty