i'm not using gist as pastebin anyway
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// parse-ms | |
// MIT License, copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com) | |
// Modified by Dobby233Liu in slight cooperation with MIT License | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), | |
// to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
// and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | |
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get What Can Be Crafted By Thou Numbers And Also Their Sum (GWCB2TNA2TS) | |
// WTFPL | |
// but, opitmiz and credit suggested... can you opitmiz it better than my better anyway? (optmiz my better one, not others!) tell me by forking, coding and commenting! | |
// beautified using https://beautifier.io | |
function gwcb2tna2ts(im = 4, jm = 4, km = 4) | |
{ // https://blog.csdn.net/cherrydreamsover/article/details/79750556 port | |
im++; | |
jm++; | |
km++; | |
var i = 0; // 百位 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- deduplicate value-only table | |
function dedupTable(origtable) | |
function tableContainsV(tablee, value) | |
local fr = false | |
for i = 1, #tablee do | |
if tablee[i] == value then | |
fr = true | |
break -- i had breakfast today | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateStringByTemplate(arr){ | |
// FIXME: This is a temporary solution. It may cause overflows. | |
// If you have an excellent way to do this, tell me. | |
main = "" | |
for (i of arr) { | |
z = "" | |
if (typeof i != "string") { // is i not a string? | |
if (Array.isArray(i)) | |
z = i // assign a placeholder | |
else |
- Drop all rpy files to
game/tl/zh
- Drop XiaolaiSC-Regular.ttf to
game/tl/zh
with filenamesp-xiaolai-p.ttf
- Drop some lines under
define lang_
lines ingame/screens.rpy
# Dobby233Liu: xiaolai is literally seto, but the improved version
define lang_zh = "{font=tl/zh/sp-xiaolai-p.ttf}简体中文{/font}"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import re | |
import demoji | |
if __name__ == "__main__" and demoji.last_downloaded_timestamp() == None: | |
demoji.download_codes() | |
URL_REGEX = re.compile("http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+", flags=re.I) | |
HASHTAG_REGEX = re.compile("((?:^|\uFE0E|\uFE0F|$|(?!(?:[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u052f\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u065f\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06ef\u06fa-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07ca-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0-\u08b2\u08e4-\u0963\u0971-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09f0\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <x86.h> | |
#define lastIntroNote 0+26*2 | |
#define lastNote song_LEN // very last entry in song | |
unsigned int soundIndex = 0; // NTS: use song only for indexing. NOTE: may want to expand | |
unsigned short soundWait = 0; | |
// NOTE: this is supposed to run per tick |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open("musiccmt.txt","r",encoding="shift-jis") as c: | |
cmt = c.readlines() | |
writemode=None | |
linen=0 | |
max=9 | |
total=0 | |
m3u8=open("musicroom.m3u8","w",encoding="utf-8") | |
m3u8.write("#EXTM3U\n") | |
str="" | |
for line in cmt: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
random.seed() | |
lettertable = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz " | |
def rand_word(): | |
while True: | |
random.seed() | |
r = "" | |
len = random.randint(6, 12) |