Skip to content

Instantly share code, notes, and snippets.

View pcchou's full-sized avatar

Ping-yu Chou pcchou

View GitHub Profile
@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 / 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 / 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 / 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 / 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!
-- This exercise covers the first 6 chapters of "Learn You a Haskell for Great Good!"
-- Chapter 1 - http://learnyouahaskell.com/introduction
-- Chapter 2 - http://learnyouahaskell.com/starting-out
-- Chapter 3 - http://learnyouahaskell.com/types-and-typeclasses
-- Chapter 4 - http://learnyouahaskell.com/syntax-in-functions
-- Chapter 5 - http://learnyouahaskell.com/recursion
-- Chapter 6 - http://learnyouahaskell.com/higher-order-functions
-- Download this file and then type ":l Chapter-1-6.hs" in GHCi to load this exercise
@pcchou
pcchou / index.html
Last active August 25, 2017 01:45
JyBZEo
<div id="stars"></div>
<div id="stars2"></div>
<div id="stars3"></div>
<div id="main">
<h1>HITCON CMT 2017 Interperter Service</h1>
<h2><a href="http://interpreter.hitcon.org:8000/r0">R0</a></h2>
<h2><a href="http://interpreter.hitcon.org:8000/r1">R1</a></h2>
<h2><a href="http://interpreter.hitcon.org:8000/r2">R2</a></h2>
</div>