Skip to content

Instantly share code, notes, and snippets.

💭
🐝 Bzz!

Christopher Robert Van Wiemeersch cvan

💭
🐝 Bzz!
Block or report user

Report or block cvan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cvan
cvan / vimeo-spa-hijack-link-clicks.js
Created May 21, 2019
Vimeo.com script: hijack SPA links to do synchronous page loads (instead of single-page-app URL routing)
View vimeo-spa-hijack-link-clicks.js
@cvan
cvan / oculusvr-video-setup.sh
Last active May 16, 2019
`adb` commands to call for capturing high-res videos on Oculus VR headsets
View oculusvr-video-setup.sh
#!/bin/sh
# `adb` commands to call for capturing high-res videos on Oculus VR headsets
#
# Usage:
#
# curl https://gist.githubusercontent.com/cvan/54535a41db8a67d0370971f6e393675d/raw/c2183adf4bf0e85edc422a13599eba54e62ee473/video-setprop.sh > /tmp/oculusvr-video-setup.sh
# chmod +x /tmp/oculusvr-video-setup.sh
# ./tmp/oculusvr-video-setup.sh
#
@cvan
cvan / qsutils.js
Last active May 13, 2019
QSUtils: a query-string utility for browser/client-side JavaScript. supports case-insensitive, truthy, typed values, defaults. (demo: https://qsutils.glitch.me/)
View qsutils.js
/**
* QSUtils: a query-string utility for browser/client-side JavaScript.
*
* supports case-insensitive, truthy, typed values, defaults.
*
* demo: https://qsutils.glitch.me/
*/
class QSUtils {
constructor () {
this.qs = new URLSearchParams(window.location.search);
@cvan
cvan / adb-shell-getprop.js
Created Apr 16, 2019
output `adb shell getprop` to a file
View adb-shell-getprop.js
adb shell getprop > props__$(date +%F_%T).ini
@cvan
cvan / vimeo-add-video-to-channel.js
Last active Apr 16, 2019
automatically add a Vimeo video to your Vimeo channel playlist (JavaScript browser code snippet)
View vimeo-add-video-to-channel.js
// 1. Ensure you are signed in (if not, visit https://vimeo.com/log_in).
// 2. Set `VIMEO_CHANNEL_ID` below to the channel ID corresponding to the channel you want to add the video to.
// The channel ID appears at the end of the channel URL (e.g., https://vimeo.com/channels/1434599).
// See the other script for a snippet to run to navigate to your list of channels.
// 3. If you're logged in, from a video page on Vimeo, enter this in the Console from your browser's Dev Tools:
VIMEO_CHANNEL_ID = 1434599; document.querySelector('.collections-button').click(); setTimeout(() => { document.querySelector(`input[id="${VIMEO_CHANNEL_ID}"]`).checked = true; }, 500); window.close();
@cvan
cvan / webvr-moonrise-history.md
Last active Apr 9, 2019
WebVR History: Project Moonrise (by @caseyyee and @cvan; Mozilla, 2017)
View webvr-moonrise-history.md

Using Myk Melez's qbrt project, @cvan's maintained a forked branch, vr, as the foundation for building a standalone, self-contained executable of Desktop Firefox w/ enabled-by-default WebVR Support.

Done in March – April 2017 at Mozilla in the Mixed Reality program, this experiment was led by @cvan and @caseyyee, codenamed Moonrise.

image

  • Moonrise could generate Windows, macOS, and Linux releases of a wrapper program of this branch of qbrt.
  • Moonrise's default start page was a WebVR-powered Lobby experience
  • Moonrise could connect to a user's Steam account (if the user was already locally authenticated in the Steam app, Steam's user-management APIs worked witho
@cvan
cvan / gh-latest-releases.js
Last active Apr 8, 2019
GitHub Releases: Get list of URLs to download (w/ grouping and filtering by filename patterns + platform/architecture)
View gh-latest-releases.js
// Source: https://gist.github.com/cvan/d37e7d78ce114ba15e3736af18acfdac
// Author: CVAN <https://cvan.io>
const fs = require('fs');
const os = require('os');
const path = require('path');
// Source: https://gist.github.com/cvan/ef28f73b88b991d4a9705314b2af2e78#file-system-js
// Author: CVAN <https://cvan.io>
// Useful helper snippet for understanding the capabilities of a user's system from Node.js' built-in `process.arch` and `process.platform`.
const system = {
@cvan
cvan / help.js
Last active Apr 8, 2019
[Node.js] get Operating-System Platform (Windows, macOS, Linux) and Architecture (x32, x64, etc.) (without any third-party npm dependencies)
View help.js
const os = require('os');
// See docs: https://nodejs.org/api/os.html
const usage = {};
usage[`require('os').type()`] = {
value: os.type(),
otherValues: [
'Linux', 'Darwin', 'Windows_NT'
],
@cvan
cvan / downloader.js
Last active Apr 8, 2019
download URLs to disk (without any third-party npm dependencies)
View downloader.js
// Source: https://gist.github.com/cvan/da899090fa6c38f87dacbef95ea5d785#file-downloader-js
// Author: CVAN <https://cvan.io>
const fs = require('fs');
const http = require('http');
const https = require('https');
const path = require('path');
const URL = require('url');
const utils = {};
utils.getSafeTimestamp = () => new Date().toISOString().slice(0, 23).replace(/:/g, '.');
You can’t perform that action at this time.