Skip to content

Instantly share code, notes, and snippets.

View FiveYellowMice's full-sized avatar
:electron:
Reluctantly relying on Electron

Alex Huang FiveYellowMice

:electron:
Reluctantly relying on Electron
View GitHub Profile
@FiveYellowMice
FiveYellowMice / question-box.php
Created December 30, 2019 13:41
FiveYellowMice 的提问箱
<?php
function return_error($code, $message) {
http_response_code($code);
header('Content-Type: text/plain');
echo $message."\n";
die();
}
if (in_array($_SERVER['REQUEST_METHOD'], ['HEAD', 'GET'])) {
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 8c04cb5..132d803 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -104,6 +104,9 @@
have_func("SSLv2_method")
have_func("SSLv2_server_method")
have_func("SSLv2_client_method")
+have_func("SSLv3_method")
+have_func("SSLv3_server_method")
[
{
"content": "我从来不把安逸和快乐看作是生活目的本身,对这种伦理基础,我称之为“猪栏的理想”。",
"author": "爱因斯坦"
},
{
"content": "人生中最大的两个财富是:你的才华和你的时间。才华越来越多而时间越来越少。我们的一生就是用时间来换取才华。"
},
{
"content": "这辈子没法做太多的事情,所以每一件都要做到精彩绝伦!",
@FiveYellowMice
FiveYellowMice / taiko_practice_bot.php
Last active October 21, 2019 09:45
太鼓の達人練習ボット
<?php
/*
Copyright 2019 FiveYellowMice
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, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@FiveYellowMice
FiveYellowMice / artemis_extract.rb
Last active December 27, 2018 09:09
Extracts files from Artemis Engine resource files (.psf).
#!/usr/bin/env ruby
# encoding: utf-8
# fronze_string_literal: true
##
# Extracts files from Artemis Engine resource files (.psf).
#
# Tested on:
# - Memory's Dogma CODE:01
@FiveYellowMice
FiveYellowMice / https-ssl-tls-1.md
Last active October 18, 2018 03:35
编程随想的扫盲 HTTPS 第一期

扫盲 HTTPS 和 SSL/TLS 协议[1]:背景知识、协议的需求、设计的难点 - 复制自编程随想的博客

★相关背景知识

  要说清楚 HTTPS 协议的实现原理,至少需要如下几个背景知识。

  1. 大致了解几个基本术语(HTTPS、SSL、TLS)的含义
  2. 大致了解 HTTP 和 TCP 的关系(尤其是“短连接”VS“长连接”)
  3. 大致了解加密算法的概念(尤其是“对称加密与非对称加密”的区别)
  4. 大致了解 CA 证书的用途
@FiveYellowMice
FiveYellowMice / mc-im.rb
Created November 26, 2016 11:30
在 Linux 下的 Minecraft 中输入中文。拥有比 bash 脚本更好的鲁棒性,适应多种情形,并绕过了一些坑。
#!/usr/bin/env ruby
# encoding: utf-8
# frozen_string_literal: true
# mc-im.rb
# ========
#
# 在 Linux 下的 Minecraft 中输入中文。拥有比 bash 脚本更好的鲁棒性,适应多种情形,并绕过了一些坑。
#
# 使用方法
<?php
define('PREPARED_MOONS', [
'apple_new_moon_with_face',
'apple_full_moon_with_face',
'apple_ios10_new_moon_with_face',
'apple_ios10_full_moon_with_face',
'noto_new_moon_with_face',
'noto_full_moon_with_face',
'segoe_new_moon_with_face',
@FiveYellowMice
FiveYellowMice / idc_chicories.rb
Created February 9, 2017 11:19
IDCChicories plugin for HoroBot2
# frozen_string_literal: true
require 'active_support/core_ext/numeric/time'
class HoroBot2::Plugins::IDCChicories < HoroBot2::Plugins::Base
RECEIVE_ONLY_WHEN_MATCH = /(?<!\w)(?:线路|骨干网|教育网|数据中心|線路|骨幹網|教育網|數據中心|IDC|BGP|OVH|AnyCast|NTT|QoS|PCCW|IMS|TEA|Cogent|[a-z]{2,3}NET|GRX|IPX|TFN|CN2|CERNET|[a-z]{2}IX|[EG]PON)(?!\w)/i
MESSAGE = "\u{1f31a} IDC 大佬们又要开始谈笑风生了。"
#!/usr/bin/env ruby
# frozen_string_literal: true
class HoroSpeak
attr_accessor :debug_mode