Skip to content

Instantly share code, notes, and snippets.

Moved to repo: /quenhus/uBlock-Origin-dev-filter

In order to keep filters up to date, please use this repo.

@Eotones
Eotones / README.md
Last active November 1, 2022 09:45
Nightbot自訂Twitch指令 - 美金和台幣匯率換算 (下方有新增其他Nightbot自訂指令)

Nightbot自訂Twitch指令 - 美金和台幣匯率換算

USD 轉 TWD

Twitch聊天室輸入指令新增:

!commands add !usd $(eval const n=parseFloat('$(query)');if(!isNaN(n)){const api = $(urlfetch json https://tw.rter.info/capi.php); api.error || (!api.USDTWD.Exrate) ? '查無資料' : `${n} USD = ${(n*api.USDTWD.Exrate).toFixed(2)} TWD (source: RTER)`;}else{'請在指令後面輸入數字'})
@si458
si458 / build.js
Last active December 28, 2023 10:18
build script for pkg with icon and metainfo
if (process.argv[2] == undefined) process.exit(0);
if (process.argv[2] == "") process.exit(0);
const { pkg_fetch_version, node_version, pkg_cache_path, icon, version, description, company, name, copyright, file } = require(`./${process.argv[2]}.json`);
const ResEdit = require('resedit');
const path = require("path");
const fs = require('fs');
const https = require('https');
function download(url, dest) {
return new Promise((resolve, reject) => {
fs.access(dest, fs.constants.F_OK, (err) => {
@Prezens
Prezens / gist:f99fd28124b5557eb16816229391afee
Created April 2, 2019 07:40
Apache .htaccess settings for Vue, vue-router
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations
@Eotones
Eotones / README.md
Last active March 14, 2024 08:30
speechSynthesis強制使用Chrome中的Google小姐中文語音

speechSynthesis強制使用Chrome中的Google小姐中文語音

網路上的window.speechSynthesis教學主要都只有說切換指定語言

像是這樣就能切換成中文語音:

const synth = window.speechSynthesis;

const speak = (msg) => {
@dragonwocky
dragonwocky / discord-webhook.js
Last active April 24, 2024 16:07
js post request example for discord webhooks using the fetch web api
// node.js versions pre-v0.18.0 do not support the fetch api and require a polyfill
// const fetch = require('node-fetch');
fetch(
'https://discordapp.com/api/webhooks/738983040323289120/mzhXrZz0hqOuUaPUjB_RBTE8XJUFLe8fe9mgeJjQCaxjHX14c3SW3ZR199_CDEI-xT56',
{
method: 'post',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
@jfcherng
jfcherng / LunarCalendar.php
Last active January 11, 2024 09:27
PHP 農曆相關
<?php
class Lunar
{
const MIN_YEAR = 1891;
const MAX_YEAR = 2100;
const LUNAR_INFO = [
[0, 2, 9, 21936], [6, 1, 30, 9656], [0, 2, 17, 9584], [0, 2, 6, 21168], [5, 1, 26, 43344], [0, 2, 13, 59728],
[0, 2, 2, 27296], [3, 1, 22, 44368], [0, 2, 10, 43856], [8, 1, 30, 19304], [0, 2, 19, 19168], [0, 2, 8, 42352],
@julianpoemp
julianpoemp / .angular-htaccess.md
Last active April 14, 2024 21:40
Optimal .htaccess configuration for Angular 15, Angular 14, Angular 13, Angular 12, Angular 11, Angular 10, Angular 9, Angular 8, Angular 7, Angular 6, Angular 5 (and older) app in production incl. fix for the angular browser caching issue.

New generator

I created a new htaccess generator for angular apps that makes it easier for you to create the optimal htaccess file: https://julianpoemp.github.io/ngx-htaccess-generator/

The goal of this generator is to create the optimal .htaccess file for Angular apps easily. By default the generator creates an .htaccess file that solves the route redirection issue. To make it easier for you I created a kind of interview mode with some questions. As an additional feature the generator supports adding exclusions for example if you have installed a blog in a subdirectory of your web application and more!

The generator 😁: https://julianpoemp.github.io/ngx-htaccess-generator/

The project: https://github.com/julianpoemp/ngx-htaccess-generator

@theho
theho / nginx.conf
Created December 2, 2017 15:38 — forked from duckfullstop/nginx.conf
nginx-rtmp at LAN sample configuration
##################
## LANSTREAM ##
##################
# This is a sample configuration file
# Please don't copy and paste this exactly, read through it and understand what you're doing
# nginx-rtmp can be a little strange when working multithreaded, so we turn it off
worker_processes 1;