Skip to content

Instantly share code, notes, and snippets.

@rxctionzz
rxctionzz / index.html
Created October 13, 2022 13:54
Traffic Run Game with Three.js
<div id="score">Press UP</div>
<div id="controls">
<div id="buttons">
<button id="accelerate">
<svg width="30" height="30" viewBox="0 0 10 10">
<g transform="rotate(0, 5,5)">
<path d="M5,4 L7,6 L3,6 L5,4" />
</g>
</svg>
@rxctionzz
rxctionzz / 10-functions-from-rxjs-merge-concat.markdown
Created October 19, 2022 13:33
10 Functions from RxJS // merge & concat

10 Functions from RxJS // merge & concat

Rx.Observable.merge/concat examples for SitePoint's 10 Fundamental Functions from RxJS.

A Pen by SitePoint on CodePen.

License.

@rxctionzz
rxctionzz / script.vue
Created October 25, 2022 23:08
Vue Options API Example
<!-- Use preprocessors via the lang attribute! e.g. <template lang="pug"> -->
<template>
<div id="app">
<h2>{{date}}</h2>
<p>I drank {{cupsOfWater}} cups of water today 🥤</p>
<button @click="drinkCup">Drink a cup</button>
<p v-if='cupsOfWater > 0'>I drank the last cup at {{lastCup}}</p>
</div>
</template>
const url = new URL('http://user:pass@example.com:8080/resource/path?q=1#hash');
console.log('href:', url.href);
console.log('protocol:', url.protocol);
console.log('username:', url.username);
console.log('password:', url.password);
console.log('host:', url.host);
console.log('hostname:', url.hostname);
console.log('port:', url.port);
console.log('pathname:', url.pathname);
@rxctionzz
rxctionzz / app-menu-with-lock-screen.markdown
Created November 29, 2022 16:37
App Menu With Lock Screen

App Menu With Lock Screen

A kind of large menu inspired by the Google TV interface. Also has a lock screen component just for funsies.

A Pen by Hyperplexed on CodePen.

License.

// Catch errors since some browsers throw when using the new `type` option.
// https://bugs.webkit.org/show_bug.cgi?id=209216
try {
// Create the performance observer.
const po = new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
// Logs all server timing data for this response
console.log('Server Timing', entry.serverTiming);
}
});
@rxctionzz
rxctionzz / bytes.m
Created December 10, 2022 21:18
M implementation that builds up the bytes then converts to text as UTF-8 binary
let
InputData = Csv.Document("a=b
=ab
ab=
abc☃def"),
Uri.UnescapeDataString = (data as text) as text => let
ToList = Text.ToList(data),
Accumulate = List.Accumulate(ToList, [ Bytes = {} ], (state, current) =>
let
(function() {
var html = document.documentElement;
var buildNumberAttribute = 'data-cw-private-build-number';
var masteringNumberAttribute = 'data-cw-private-mastering-number';
window._BUILD_INFO_FOR_GLOBAL_ERROR_HANDLERS = {
buildNumber: html.getAttribute(buildNumberAttribute),
masteringNumber: html.getAttribute(masteringNumberAttribute),
locale: html.getAttribute("lang")
};