Skip to content

Instantly share code, notes, and snippets.

Alex Huang FiveYellowMice

Block or report user

Report or block FiveYellowMice

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@FiveYellowMice
FiveYellowMice / taiko_practice_bot.php
Last active Oct 20, 2019
太鼓の達人練習ボット
View taiko_practice_bot.php
<?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
View fortunes.json
[
{
"content": "我从来不把安逸和快乐看作是生活目的本身,对这种伦理基础,我称之为“猪栏的理想”。",
"author": "爱因斯坦"
},
{
"content": "人生中最大的两个财富是:你的才华和你的时间。才华越来越多而时间越来越少。我们的一生就是用时间来换取才华。"
},
{
"content": "这辈子没法做太多的事情,所以每一件都要做到精彩绝伦!",
@FiveYellowMice
FiveYellowMice / artemis_extract.rb
Last active Dec 27, 2018
Extracts files from Artemis Engine resource files (.psf).
View artemis_extract.rb
#!/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 Oct 18, 2018
编程随想的扫盲 HTTPS 第一期
View https-ssl-tls-1.md

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

★相关背景知识

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

  1. 大致了解几个基本术语(HTTPS、SSL、TLS)的含义
  2. 大致了解 HTTP 和 TCP 的关系(尤其是“短连接”VS“长连接”)
  3. 大致了解加密算法的概念(尤其是“对称加密与非对称加密”的区别)
  4. 大致了解 CA 证书的用途
@FiveYellowMice
FiveYellowMice / mc-im.rb
Created Nov 26, 2016
在 Linux 下的 Minecraft 中输入中文。拥有比 bash 脚本更好的鲁棒性,适应多种情形,并绕过了一些坑。
View mc-im.rb
#!/usr/bin/env ruby
# encoding: utf-8
# frozen_string_literal: true
# mc-im.rb
# ========
#
# 在 Linux 下的 Minecraft 中输入中文。拥有比 bash 脚本更好的鲁棒性,适应多种情形,并绕过了一些坑。
#
# 使用方法
View contaminative-moons.php
<?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 Feb 9, 2017
IDCChicories plugin for HoroBot2
View idc_chicories.rb
# 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 大佬们又要开始谈笑风生了。"
View ruby-1.9.3-openssl-sslv3-patch.patch
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")
View horospeak.rb
#!/usr/bin/env ruby
# frozen_string_literal: true
class HoroSpeak
attr_accessor :debug_mode
@FiveYellowMice
FiveYellowMice / delete-old-screenshots.rb
Created Nov 26, 2016
Automatically delete old screenshots. Run as a systemd timer or cron job.
View delete-old-screenshots.rb
#!/usr/bin/env ruby
SCREENSHOTS_DIR = ENV['SCREENSHOTS_DIR'] ||
ENV['HOME'] + '/Pictures/Screenshots'
MAXIMUM_TIME = ENV['MAXIMUM_TIME'] ||
60 * 60 * 24 # 1 day
#######################################
#
You can’t perform that action at this time.