Skip to content

Instantly share code, notes, and snippets.

View ylxdzsw's full-sized avatar
🐟
摸鱼

ylxdzsw

🐟
摸鱼
View GitHub Profile
@ylxdzsw
ylxdzsw / nopaste_lite.html
Last active October 25, 2022 14:55
Ugly alternative to [nopaste](https://github.com/bokub/nopaste), but is a self-contained single-file HTML. [Live version](https://nopaste.ylxdzsw.com/)
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<p><a href="https://caniuse.com/?search=deflate-raw">only these browsers are supported<a>
<p><textarea rows=10 cols=50 style="font: .9em monospace"></textarea>
<p><label>Password: <input></input></label> <button id="decrypt">Decrypt</button>
<p id="fool" style="display: none"><a href="https://xkcd.com/936/">Don't fool yourself with a weak password</a>
<p><button id="getlink">GetLink</button> (Will encrypt if password is not empty)
<pre><a></a></pre>
<script>
document.querySelector("#getlink").addEventListener("click", async () => {
const text = document.querySelector("textarea").value
# draw 100 balls of 40 colors, where the color of each ball is uniformly random, the probability of drawn at least 1 ball of each color
def g(colors, balls):
total_colors = colors
cache = {}
def f(rest_colors, rest_balls):
if (rest_colors, rest_balls) in cache:
return cache[(rest_colors, rest_balls)]
if rest_colors == 0:
return 1
if rest_balls == 0:
def next_node_value(i, n):
if i % 2 == 0:
return i // 2
else:
return n - (i // 2) - 1
def f(array, edgearray, i, n):
if i >= n:
print(n, array)
raise 0
rsync -aAX --info=progress2 --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*"} / "/mnt/2022-04-29"
import bminf
import threading
from flask import Flask
model = bminf.models.EVA()
# model = bminf.models.CPM2(memory_limit=10<<30)
context = []
lock = threading.Lock()
app = Flask(__name__)
for e in bad_events {
try {
suppress(e);
} catch (SocialMediaDicussion) {
meeting();
meeting();
meeting();
order_related_cooperations_to_solve_it(budget=Promise.new(fulfill_time=next_term));
if result is good {
news_press("We solved the problem promptly and thoroughly");
@ylxdzsw
ylxdzsw / revolve4times.html
Created June 10, 2020 08:37
For a stupid question
<style>
html, body, div {
padding: 0;
margin: 0;
}
#big {
border-radius: 50%;
width: 300px;
height: 300px;
@ylxdzsw
ylxdzsw / cfmonitor.coffee
Created May 1, 2020 16:45
A failed attempt to abuse cloudflare workers as a web monitor.
serverchan_token = ''
telegram_token = ''
telegram_chatid = ''
secret = '' # it also acts as instance ID. Change this everytime you restart the script.
host1 = ''
host2 = '' # we need two hosts because of https://community.cloudflare.com/t/issue-with-worker-to-worker-https-request/94472
addEventListener 'fetch', (e) ->
e.respondWith main e
@ylxdzsw
ylxdzsw / ffplay.desktop
Created February 15, 2020 18:35
Desktop file for using ffplay as the video/audio player
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=FFPlay
Exec=ffplay %U
NoDisplay=true
Categories=AudioVideo;Audio;Video;Player;
MimeType=application/mxf;application/ogg;application/ram;application/sdp;application/smil;application/smil+xml;application/vnd.apple.mpegurl;application/vnd.ms-asf;application/vnd.ms-wpl;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;application/x-extension-m4a;application/x-extension-mp4;application/x-flac;application/x-flash-video;application/x-matroska;application/x-netshow-channel;application/x-ogg;application/x-quicktime-media-link;application/x-quicktimeplayer;application/x-shorten;application/x-smil;application/xspf+xml;audio/3gpp;audio/3gpp2;audio/aac;audio/ac3;audio/AMR;audio/AMR-WB;audio/basic;audio/dv;audio/eac3;audio/flac;audio/m4a;audio/midi;audio/mp1;audio/mp2;audio/mp3;audio/mp4;audio/mpeg;audio/mpegurl;audio/mpg;audio/ogg;audio/opus;audio/prs.sid;audio/scpls;audio/vnd.rn-realaudio;audio/wav;audio/webm;audio/x-aac;
@ylxdzsw
ylxdzsw / local.conf
Created February 15, 2020 17:30
My /etc/fonts/local.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>monospace</family>
<prefer>
<family>Droid Sans Mono</family>
<family>Noto Sans Mono CJK SC</family>
</prefer>
</alias>