Skip to content

Instantly share code, notes, and snippets.

View pcchou's full-sized avatar

Ping-yu Chou pcchou

View GitHub Profile
@pcchou
pcchou / compile_sl_under_windows.md
Last active April 13, 2024 15:09
如何在 Windows 下編譯 sl (Steam Locomotive)

如何在 Windows 下編譯 sl (Steam Locomotive)

各位在剛剛算法班的課堂上,應該都透過講師大大體驗到 sl (Steam Locomotive) 的魅力了,相信大家都認為它是個好東西, 不過大家只看到在 Linux 上能享受 sl,想必身為 Windows 使用者的你一定很不是滋味吧!

在這裡,我將告訴大家如何在 Windows 上也能讓 sl 帶給你滿滿的趣味,讓你不再因為打錯 ls 而感到難過。(才怪)

Prerequisites

  • MinGW (如果有 DevC++ 或 CodeBlocks 應該就有)
@pcchou
pcchou / twitter.com.css
Created August 2, 2023 19:23
Replaces X to Twitter on twitter.com
.css-1dbjc4n.r-1pi2tsx.r-1wtj0ep.r-1rnoaur.r-1pn2ns4.r-o96wvk div.css-1dbjc4n.r-xoduu5 > .css-901oao.css-16my406.r-poiln3.r-bcqeeo.r-qvutc0 > .css-901oao.css-16my406.r-poiln3.r-bcqeeo.r-qvutc0 {
/* display: none; */
display: inline-block;
overflow: hidden;
text-indent: -9999px;
padding-top: 4px;
}
.css-1dbjc4n.r-1pi2tsx.r-1wtj0ep.r-1rnoaur.r-1pn2ns4.r-o96wvk div.css-1dbjc4n.r-xoduu5 > .css-901oao.css-16my406.r-poiln3.r-bcqeeo.r-qvutc0 > .css-901oao.css-16my406.r-poiln3.r-bcqeeo.r-qvutc0::before {
content: "推文";
@pcchou
pcchou / index.html
Last active November 8, 2022 05:28
Simple timeline with CSS
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CodePen - Simple timeline with CSS</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="box">
<div id="check-left-line"></div>
@pcchou
pcchou / 3035.py
Last active April 7, 2022 19:16
3035 bearrrrrrrro的綽號們
n = int(input())
dic = {}
for _ in range(n):
inputs = input().split()
op = int(inputs[0])
if op == 1:
nickname = inputs[1]
if nickname in dic:
dic[nickname] += 1
else:
@pcchou
pcchou / 3052.py
Last active April 7, 2022 19:15
3052 海芭樂愛的大冒險III
n = int(input())
score = {}
for _ in range(n):
name, status = input().split()
if status == "AC":
if name in score:
score[name] += 1
else:
score[name] = 1
@pcchou
pcchou / 3055.py
Last active April 7, 2022 19:14
3055 凌晨4點的修羅道
score_board = {}
while True:
k = input()
if k=="DATA_INPUT_END":
break
k = k.split()
score_board[k[0]] = k[1]
while True:
k = input()
if k=="END":
@pcchou
pcchou / post.py
Last active May 22, 2021 07:29
Facebook post parsing bs4 class (2017)
from bs4 import BeautifulSoup as Soup
from requests import get as GET, post as POST
parse_cookie = lambda cookies: dict(map(lambda x: x.split('='), map(lambda x: x.replace(' ', ''), cookies.split(';'))))
COOKIE_STRING = ""
REQARGS = {'cookies': parse_cookie(COOKIE_STRING), 'headers': {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36'}}
class Post:
def react(self, name):
@pcchou
pcchou / Handler.py
Created May 9, 2021 06:52
一階大作業參考用 Sample
import config
def getCellsAbsolutePosition(piece):
'''取得方塊當前所有方格的座標'''
return [(y + piece.y, x + piece.x) for y, x in piece.getCells()]
def fixPiece(shot, piece):
'''固定已落地的方塊,並且在main中自動切到下一個方塊'''
@pcchou
pcchou / Handler_practice.py
Last active May 3, 2021 06:47
Finished part3(資芽 py 2021 大作業練習)
import config
def getCellsAbsolutePosition(piece):
'''取得方塊當前所有方格的座標'''
return [(y + piece.y, x + piece.x) for y, x in piece.getCells()]
def printPiece(shot, piece):
print('目前方塊:', getCellsAbsolutePosition(piece))
### Let's practice NOW!
@pcchou
pcchou / write-up.md
Last active May 3, 2021 06:47
AIS3 pre-exam write-ups. (tempopary)

AIS3 pre-exam 簡單的 write-up

web1

Flag: ais3{Y0u_beat_the_G00g1e!!}

題目:

https://quiz.ais3.org:8011/