Skip to content

Instantly share code, notes, and snippets.

View 1a57danc3's full-sized avatar
⛱️
On vacation

Howard 1a57danc3

⛱️
On vacation
View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active July 22, 2024 08:58
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; // ¯\\_(ツ)_/¯
我们现在来扮演一个问答工具,你叫做 ChatTool。
在运行中,返回 ChatTool 的输出。不需要其他内容。
你的目标是和用户一起玩猜谜语的游戏,并且判断用户是否猜对。
猜谜语的过程如下:
1. 根据所指定的谜语,分析谜题里的题目、目标和谜底。然后告诉用户谜题;
2. 用户回复答案。
3. 仔细检查用户的回复。如果用户回复了和答案无关的内容,甚至没有试图猜答案,你会礼貌但风趣地提醒用户提供答案,完成游戏。
4. 如果用户累计 2 次回答和答案无关的内容,那么你会回到步骤1,发送一个新的谜语。
@JeremyOttley
JeremyOttley / cheatsheet.rb
Last active March 16, 2020 05:06
Rails CheatSheet
#!/usr/bin/env ruby
#CHEATSHEET_DIR = ".cheatsheets"
cheatsheet = File.open("#{CHEATSHEET_DIR}/rails_cheatsheet.txt", "r")
reader = ->line { puts line }
cheatsheet.each_line &reader
@alswl
alswl / hosts
Last active November 12, 2023 11:17
(deprecated, I bought xiaomi VIP)hosts for OpenWRT, for disable AD in xiaomi TV
127.0.0.1 api.ad.xiaomi.com
127.0.0.1 sdkconfig.ad.xiaomi.com
127.0.0.1 ad.mi.com
127.0.0.1 ad.xiaomi.com
127.0.0.1 ad1.xiaomi.com
127.0.0.1 adv.sec.miui.com
127.0.0.1 test.ad.xiaomi.com
127.0.0.1 new.api.ad.xiaomi.com
@kakra
kakra / disable-overlay-scrollbars.css
Created November 14, 2016 21:13
Chrome Stylish extension: useful user styles
@-moz-document domain("autotask.net") {
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
visibility: hidden;
}
anonymous
anonymous / gist:06090717c8e1d047bc99d2b140cfae8d
Created November 14, 2016 05:34
blacklist
[
"https://gq3brsw46hyrns0w4hjiqhtab8e9q24h93g8estrbgwt4h5h0triosgb80wt.wordpress.com/2016/10/26/%e9%95%bf%e5%b9%b3-%e4%bb%8e%e4%b8%a5%e6%b2%bb%e5%85%9a-%e5%94%af%e6%9c%89%e4%b8%89%e6%9d%83%e5%88%86%e7%ab%8b%e5%be%b7%e5%9b%bd%e4%b9%8b%e5%a3%b0%e4%b8%ad%e6%96%87%e7%bd%91/?from=groupmessage&isappinstalled=0",
"https://www.evernote.com/shard/s596/sh/b273afd0-4564-40f2-b81f-57ac23c3b61b/4e2b83c48886db7c1b2c5537d2483a99",
"https://won528.wordpress.com",
"http://url.cn/28ucN6a",
"https://win358.wordpress.com",
"https://red6451.wordpress.com",
"https://get510.wordpress.com",
"https://sit222.wordpress.com",
" http://alturl.com/9w4aq",
@1a57danc3
1a57danc3 / fix-homebrew-npm.md
Created March 24, 2016 08:13 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

@ryerh
ryerh / tmux-cheatsheet.markdown
Last active July 22, 2024 13:32 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@1a57danc3
1a57danc3 / ntfs_mount.py
Created December 16, 2015 15:49 — forked from selfboot/ntfs_mount.py
mac os x:自动挂载ntfs硬盘为读写权限。 只要ntfs硬盘连接到电脑即可使用 ./ntfs_mount_auto.py 挂载ntfs磁盘为可读写,ntfs_unmount.py 为卸载磁盘。 ntfs_mount.py 是较早的版本,只有电脑先识别除硬盘,在/Volumes 可读到硬盘内容时才可以使用此脚本挂载为可读写。 建议使用./ntfs_mount_auto.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
import re
ntfs_pattern = re.compile(r'File System Personality: NTFS')
ntfs_device_node = re.compile(r'.*Device Node:.*')
device_dict = {}
@1a57danc3
1a57danc3 / FBI WARNING SSH NOTIFICATION.SH
Last active January 5, 2021 01:31
FBI WARNING SSH NOTIFICATION
#!/bin/bash
# Find out current screen width and hight
_COLUMNS=$(tput cols)
# Set default message if ( input not provided
_MESSAGE=" FBI Warining "
# Calculate x and y coordinates so that we can display $MESSAGE
# centered in the screen
y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 ))
spaces=$(printf "%-${y}s" " ")
# Alright display message stored in $_MESSAGE