Skip to content

Instantly share code, notes, and snippets.

View devidw's full-sized avatar
🌌
realizing reality

David Wolf devidw

🌌
realizing reality
View GitHub Profile
@blixt
blixt / OculusQuest.md
Last active February 12, 2024 14:06
Streaming Oculus Quest wirelessly over WiFi to macOS (on a MacBook)

Streaming an Android-based VR headset to your computer

Setting it up the first time

The first time you have to set it up with a cable. The Oculus Quest has a USB-C port (the one used for charging). Use this to connect to your computer.

Preparing your Oculus Quest

Your Quest needs to be in Developer mode. This is super easy, just open your companion app on your phone and go to Settings and enable Developer

@kantoniak
kantoniak / FigureExtParsedown.class.php
Last active November 26, 2021 09:22
Parsedown extension to wrap single-image lines in <figure>, not <p>. Public domain. See https://github.com/erusev/parsedown/issues/180#issuecomment-451486639
<?php
class FigureExtParsedown extends Parsedown {
// Matches Markdown image definition
private $MarkdownImageRegex = "~^!\[.*?\]\(.*?\)$~";
public function __construct () {
// Add blockFigure to non-exclusive handlers for text starting with !
$this->BlockTypes['!'][] = 'Figure';
@jamesluberda
jamesluberda / graphql-for-gists.md
Created June 20, 2018 01:07
Simple User Gists Query Using GitHub GraphQL API (v4 API)

I couldn't find any examples of gists queries using GraphQL--most GraphQL examples seem to focus on traditional repositories--so here is one. As a preface, I cannot recommend strongly enough, at least when getting started, developing queries using the GitHub GraphQL Explorer. I initially started by issuing queries via curl, constructing them using the docs available on the site and a downloaded copy of the schema. Unfortunately, I ended up with errors that I couldn't quite parse. I knew, for example, from the schema, the possible field values for ordering gists. However, whenever I tried to use one of those values, the API returned that it was invalid, like so:

{"data":null,"errors":[{"message":"Argument 'orderBy' on Field 'gists' has an invalid value. Expected type 'GistOrder'.","locations":[{"line":1,"column":48}]}]}"

When I finally turned to the Explorer, I discovered that not only was the value I was using correct (field: CREATED_AT), thanks to its auto

@riipandi
riipandi / optimator.php
Last active June 27, 2023 20:05
WordPress Snippets
<?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
/*
* Plugin Name: Optimator
* Plugin URI: https://aris.web.id/
* Description: Some basic WordPress configuration optimization to make it better than default. This plugin contains other simplified plugins and snippets.
* Author: Aris Ripandi
* Author URI: https://aris.web.id/
* Version: 1.0
* License: GPLv3
* Text Domain: optimator
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active May 3, 2024 11:43
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@dcode
dcode / GitHub Flavored Asciidoc (GFA).adoc
Last active April 20, 2024 13:55
Demo of some useful tips for using Asciidoc on GitHub

GitHub Flavored Asciidoc (GFA)

@itsliamjones
itsliamjones / array-value-recursive.php
Created May 26, 2016 13:54
Get all values from specific key in a multidimensional array, similar to array_columns
<?php
/**
* Get all values from specific key in a multidimensional array
*
* @param string $key key(s) of value you wish to extract
* @param array $arr where you want
*
* @return null|string|array
*/
@gaoyifan
gaoyifan / google-fonts-proxy
Last active November 10, 2022 10:02
google-fonts-proxy
server {
listen 80;
listen 443;
listen [::]:80;
listen [::]:443;
server_name fonts.lug.ustc.edu.cn;
access_log /var/log/nginx/revproxy_access.log;
error_log /var/log/nginx/revproxy_error.log;
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active April 25, 2024 04:16
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.