Skip to content

Instantly share code, notes, and snippets.

@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 10:44
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@faishal
faishal / wp-mu-cron.sh
Created October 23, 2015 08:13
Wordpress Multisite Crontab using WP-CLI
WP_PATH="/var/www/site_path"
for SITE_URL in = $(wp site list --fields=domain,path,archived,deleted --format=csv --path="$WP_PATH" | grep ",0,0$" | awk -F ',' '{print $1 $2}')
do
echo $SITE_URL
for EVENT_HOOK in $(wp cron event list --format=csv --fields=hook,next_run_relative --url="$SITE_URL" --path="$WP_PATH" | grep 'now$' | awk -F ',' '{print $1}')
do
echo $EVENT_HOOK
wp cron event run "$EVENT_HOOK" --url="$SITE_URL" --path="$WP_PATH" > /dev/null 2>&1
done
done
@pixelsnafu
pixelsnafu / CloudsResources.md
Last active March 28, 2024 10:43
Useful Resources for Rendering Volumetric Clouds

Volumetric Clouds Resources List

  1. A. Schneider, "Real-Time Volumetric Cloudscapes," in GPU Pro 7: Advanced Rendering Techniques, 2016, pp. 97-127. (Follow up presentations here, and here.)

  2. S. Hillaire, "Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite" in Physically Based Shading in Theory and Practice course, SIGGRAPH 2016. [video] [course notes] [scatter integral shadertoy]

  3. [R. Högfeldt, "Convincing Cloud Rendering – An Implementation of Real-Time Dynamic Volumetric Clouds in Frostbite"](https://odr.chalmers.se/hand

@mwaskom
mwaskom / replacing_seaborn_distplot.ipynb
Last active March 28, 2024 10:43
A guide to replacing the deprecated `seaborn.distplot` function.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xvasi
xvasi / photos.tsx
Created March 20, 2024 09:49 — forked from ptenteromano/photos.tsx
Infinite Scroll with Remix Run
/*
* Infinite Scroll using Remix Run
* Based on client-side Scroll position
* Full Article here: https://dev.to/ptenteromano/infinite-scroll-with-remix-run-1g7
*/
import { useEffect, useState, useCallback } from "react";
import { LoaderFunction, useLoaderData, useFetcher } from "remix";
import { fetchPhotos } from "~/utils/api/restful";
import type { PhotoHash } from "~/utils/api/types";
@bjornjohansen
bjornjohansen / wp-ms-cron-ping.sh
Last active March 28, 2024 10:42
Ping cron for all sites in a WordPress multisite network
#!/bin/bash
WP_PATH="/path/to/wp"
for SITE_URL in $(wp site list --fields=url --archived=0 --deleted=0 --format=csv --path="$WP_PATH" | sed 1d)
do
/usr/bin/curl -L -s -o /dev/null "${SITE_URL}wp-cron.php"
done
@lopspower
lopspower / README.md
Last active March 28, 2024 10:37
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@kestein
kestein / Private_Crates.md
Last active March 28, 2024 10:36
Linking to a private repo in Cargo.toml

Under the dependencies section, put

<crate name>={git="ssh://git@github.com/<organization>/<reponame>.git"}

It is pretty similar to a github repo's ssh cloning link, however the : is replaced with a / and ssh:// is prepended to the URL.

git@github.com:my-organization/my-repo.git vs ssh://git@github.com/my-organization/my-repo.git

The SSH URL needs to be used because Cargo is currently unable to handle the authentication prompt that comes up when an HTTPS link is used.
Make sure that the matches the crate name in the target repo's Cargo.toml. The repo name will not override what is in the Cargo.toml if it is a different value.