Skip to content

Instantly share code, notes, and snippets.

View cvan's full-sized avatar
🚌
🌊

Christopher Van Wiemeersch cvan

🚌
🌊
View GitHub Profile
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Custom/fakeRefract" {
Properties {
}
import { Selector, ClientFunction } from 'testcafe';
fixture `Let\'s take a look at the new TestCafe`
.page `url of delivery service here (hidden not to be an ad)`;
test(`Get a pizza`, async t => {
await t
.click(Selector('#menu-primary-menu').find('li').nth(2))
.switchToIframe('iframe');
// https://webreflection.medium.com/using-the-input-datetime-local-9503e7efdce
Date.prototype.toDatetimeLocal =
function toDatetimeLocal() {
var
date = this,
ten = function (i) {
return (i < 10 ? '0' : '') + i;
},
YYYY = date.getFullYear(),
MM = ten(date.getMonth() + 1),
#!/bin/bash
set -e
rawdir="$1"
[ -z "$rawdir" ] && echo "missing dir" && exit
dir=$(cd "$rawdir" && pwd)
tmp=$(mktemp -d)
(
@DigiTec
DigiTec / README.md
Last active December 19, 2016 18:02
Transform a React VR CLI project into an OVRUI project. To get started `npm install -g react-vr-cli` for the React VR CLI to make new projects. Then `react-vr init PROJECT_NAME' to create a project directory with all of the React VR code. From here you can copy the below files into the root and they will automatically reference the node_modules …

Transform a React VR CLI project into an OVRUI project.

To get started npm install -g react-vr-cli for the React VR CLI to make new projects.

Then react-vr init PROJECT_NAME to create a project directory with all of the React VR code.

From here you can copy the below files into the root and they will automatically reference the node_modules versions of THREE and OVRUI.

@ugiacoman
ugiacoman / Client-Loading-Example.md
Last active June 24, 2022 20:50
SSR + CSR using next.js

Whether your component relies on client-side features or you are using 3rd party components that are not designed for server-side rendering, sometimes you'll want to defer rendering until on the client. For our example, we'll be using react-chart-2 to load a Doughnut chart.

Doughnut

You'll need a next project and to install chart.js + react-chartjs-2.

$ npm install --save chart.js react-chartjs-2  
@surma
surma / staleWhileRevalidate.js
Last active November 27, 2024 09:42
ServiceWorker that implements “Stale-while-revalidate”
// Implements stale-while-revalidate
self.addEventListener('fetch', event => {
const cached = caches.match(event.request);
const fetched = fetch(event.request);
const fetchedCopy = fetched.then(resp => resp.clone());
// Call respondWith() with whatever we get first.
// If the fetch fails (e.g disconnected), wait for the cache.
// If there’s nothing in cache, wait for the fetch.
// If neither yields a response, return a 404.
@-moz-document domain(youtube.com) {
.html5-play-progress, .ytp-play-progress {
background: #191970 !important; /* Old browsers */
background: -moz-linear-gradient(left, #191970 0%, #191970 100%) !important;
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#1b1b1b), color-stop(100%,#FFFFFF)) !important;
background: -webkit-linear-gradient(left, #191970 0%,#8b0000 100%) !important;
background: -o-linear-gradient(left, #191970 0%,#8b0000 100%) !important;
background: -ms-linear-gradient(left, #191970 0%,#8b0000 100%) !important;
background: linear-gradient(to right, #191970 0%,#006400 50%,#8b0000 100%) !important;
const ffmpeg = require('fluent-ffmpeg');
const moment = require('moment');
var myArgs = process.argv.slice(2);
//Convert Video
var filePath = myArgs[0];
var startTime = moment(myArgs[1], "HH:mm:ss.SSS");
var endTime = moment(myArgs[2], "HH:mm:ss.SSS");
var fileOutput = myArgs[3];