Skip to content

Instantly share code, notes, and snippets.

@hecheng337
hecheng337 / MisakaF_Reverse_Proxy.md
Last active December 13, 2024 02:58
反向代理 MisakaF 公费服 (Nginx)

如果你之前已经设置好了反向代理服务器:

1.将原来的 location / {} 复制一份,粘贴到下面;
2.在原来的 location 块中加入一行:
proxy_redirect https://MisakaF视频推流地址/ https://你服务器的地址/;
3.在复制的 location 块中,将 location / 改成 location /p/,将 proxy_pass 的目标地址改成 视频推流地址 /p/

完整的 Nginx 配置示范:

map $http_upgrade $connection_upgrade {
@jsoma
jsoma / README.md
Last active December 13, 2024 02:57
How to use pandoc and Markdown to build a simple reveal.js presentation (and a bit about how to customize it, too)

Requirements

First you need to install pandoc.

I used brew install pandoc to install via Homebrew since I'm on a mac.

Writing your presentation

Make a slides.md for your slides (or name it whatever you want!). I put images in an /images/ folder. You can see how links and images and all of that work from this sample:

@disler
disler / README.md
Last active December 13, 2024 02:55
Use Meta Prompting to rapidly generate results in the GenAI Age

Meta Prompting

In the Generative AI Age your ability to generate prompts is your ability to generate results.

Guide

Claude 3.5 Sonnet and o1 series models are recommended for meta prompting.

Replace {{user-input}} with your own input to generate prompts.

Use mp_*.txt as example user-inputs to see how to generate high quality prompts.

@eggplants
eggplants / ghcr.sh
Last active December 13, 2024 02:52
How to get information from ghcr Docker Registry HTTP API V2 with curl
#!/usr/bin/env bash
# ref: https://github.community/t/how-to-check-if-a-container-image-exists-on-ghcr/154836/3
# public image's {USER}/{IMAGE}
USER_IMAGE=eggplants/asciiquarium-docker
# get token ('{"token":"***"}' -> '***')
TOKEN="$(
curl "https://ghcr.io/token?scope=repository:${USER_IMAGE}:pull" |
awk -F'"' '$0=$4'
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@MMohan1
MMohan1 / nested_7z.py
Last active December 13, 2024 02:46
recursively Extract 7z files
import py7zlib
import os
import re
class SevenZFile(object):
@classmethod
def is_7zfile(cls, filepath):
'''
Class method: determine if file path points to a valid 7z archive.
Como ir de $0 a $10k/mês (por Josh Rush https://x.com/johnrushx/status/1838342060857770336)
1. Ideia.
○ fácil de construir (idealmente sem código (nocode))
○ pode ser explicada em uma frase
○ direcionada a um pequeno nicho B2B (business to business)
○ tem potencial de crescimento orgânico
Nunca pense: "Vou comprar anúncios para promovê-la". Isso literalmente nunca funciona.
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active December 13, 2024 02:41
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@Raulebc
Raulebc / MySQL:regiones-provincias-comunas-chile.sql
Last active December 13, 2024 02:40
MySQL-Chile:regiones-provincias-comunas
Script comunas, regiones, provincias Junio 2022
DROP TABLE IF EXISTS `comunas`;
CREATE TABLE `comunas` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`comuna` varchar(64) NOT NULL,
`provincia_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=346 DEFAULT CHARSET=utf8;
@sunjc826
sunjc826 / gh-pages-deploy.md
Created September 21, 2020 10:34 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).