Skip to content

Instantly share code, notes, and snippets.

View ZoeyWoohoo's full-sized avatar
🦖
I may be slow to respond.

Zoey ZoeyWoohoo

🦖
I may be slow to respond.
View GitHub Profile
@bruce3x
bruce3x / README.md
Last active August 31, 2022 07:01
美团技术博客 404 页面小彩蛋 🥚

彩蛋娱乐 🎊

Usage

  1. 新建 Chrome 书签,地址栏填入以下代码
javascript:const row=32,col=60,wallWidth=1,padding=1,boxSize=25,wallColor=[233,84,32,255];function index2Pixel(t){return padding+t*(boxSize+wallWidth)/2}function isWall(t,e,n){const o=index2Pixel(e),l=index2Pixel(n),a=(t,e,n)=>{const o=4*(e*t.width+n);return t.data[o]==wallColor[0]&&t.data[o+1]==wallColor[1]&&t.data[o+2]==wallColor[2]&&t.data[o+3]==wallColor[3]};return a(t,o,l)||a(t,o-1,l)||a(t,o+1,l)||a(t,o,l-1)||a(t,o,l+1)}function binaryMap(t){const e=[];for(let n=0;n<2*row+1;n++){const o=[];for(let e=0;e<2*col+1;e++)o.push(isWall(t,n,e)?1:0);e.push(o)}return e}function logMap(t){let e="";for(let n=0;n<t.length;n++){for(let o=0;o<t[n].length;o++)e+=t[n][o];e+="|||\n"}console.log(e)}function findPath(t,e,n){const o=[],l=(e,a)=>!(e<0||e>=t.length||a<0||a>=t[e].length)&&(0==t[e][a]&&(o.push([e,a]),t[e][a]=-1,e==n[0]&&a==n[1]||(!!(l(e-1,a)||l(e+1,a)||l(e,a-1)||l(e,a+1))||void o.splice(o.length-1,1))));return l(e[0],e[1]),o}function drawPath(t,e){t.lineWidth=1
@jacob-long
jacob-long / README.md
Created September 17, 2017 04:03
Prism.js line numbers plugin tweak

Notes on use

The idea here is that some of us always want line numbers but never want to add a "line-numbers" class to our HTML. This tweaked version of the plugin always adds the line numbers to any <pre> block that also has a language class that Prism will be highlighting.

To keep you from being boxed in, I've added an option to use the pre class to opt out by setting class = "no-line-numbers". If you are much more likely to want line numbers than to not want them, then this is the better way of doing things. If you think you usually don't want line numbers, then just use the plugin straight from Prism.

You should add this file after the main prism.js file on your page. Do not include the line-numbers plugin when you download Prism because you want this one to do the work and not conflict with the official one.

This may break at any time as the Prism.js teams changes the base functionality of the highlighter or the line numbers plugin.

@JanDeDobbeleer
JanDeDobbeleer / darkconemu.xml
Last active August 10, 2023 09:41
DarkConEmu.xml
<key name="Palette4" modified="2016-08-07 14:21:13" build="160724">
<value name="Name" type="string" data="DarkConEmu"/>
<value name="ExtendColors" type="hex" data="01"/>
<value name="ExtendColorIdx" type="hex" data="0f"/>
<value name="TextColorIdx" type="hex" data="0f"/>
<value name="BackColorIdx" type="hex" data="0d"/>
<value name="PopTextColorIdx" type="hex" data="0d"/>
<value name="PopBackColorIdx" type="hex" data="0d"/>
<value name="ColorTable00" type="dword" data="001e1e1e"/>
<value name="ColorTable01" type="dword" data="00cc7a00"/>
@GavinDBrown
GavinDBrown / DebouncedRunnable.Java
Last active November 2, 2020 09:12
ToggleableScrollWebView
import android.os.Handler;
public class DebouncedRunnable implements Runnable {
private long minimumInterval;
private Handler pendingHandler;
private Runnable runnable;
public DebouncedRunnable(Runnable runnable, int minimumInterval) {
this.minimumInterval = minimumInterval;