Skip to content

Instantly share code, notes, and snippets.

View RPing's full-sized avatar
🎯
Focusing

Stephen Chen RPing

🎯
Focusing
View GitHub Profile
/**
* 使用步驟:
* 瀏覽器新增書籤,並在網址欄位放入以下程式碼
* 後續只要在 risu 播放影片的頁面點擊書籤即可自動下載
* 若有密碼,須先自行輸入密碼後,進入播放影片的頁面方可有效
*/
javascript: function downloadBlobs(blob){const blobUrl=new URL(blob);const url=new URL(blobUrl.pathname);const fileName=url.pathname.replace(/^\//g,"")||"video";const a=document.createElement("a");a.href=blob;a.download=`${fileName}.mp4`;a.click()}downloadBlobs(document.getElementsByTagName("video")[0].src);
from django.conf import settings
def SessionCookieSameSiteWorkaround(get_response):
def middleware(request):
# See:
# https://blog.chromium.org/2019/10/developers-get-ready-for-new.html
# https://github.com/django/django/pull/11894
# https://web.dev/samesite-cookie-recipes/#handling-incompatible-clients
# https://www.chromium.org/updates/same-site/incompatible-clients
@tomhicks
tomhicks / plink-plonk.js
Last active July 22, 2024 09:51
Listen to your web pages
@ww9
ww9 / gist_blog.md
Last active January 12, 2024 23:00
Using Gist as a blog #blog

Blogging with Gist

Gist simplicity can turn blogging into a liberating experience.

Pros Cons
✅ Free, simple, fast, hassle-free ❌ Image upload in comments only
✅ Tagging ❌ No post pinning
✅ Search ❌ Doesn't look like a blog
✅ Revisions ❌ Unfriendly URLs
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active July 20, 2024 08:31
set -e, -u, -o, -x pipefail explanation
@tegansnyder
tegansnyder / Preventing-Puppeteer-Detection.md
Created February 23, 2018 02:41
Preventing Puppeteer Detection

I’m looking for any tips or tricks for making chrome headless mode less detectable. Here is what I’ve done so far:

Set my args as follows:

const run = (async () => {

    const args = [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-infobars',
@fkztw
fkztw / ptt_autologin.sh
Created January 9, 2018 13:53
A shell script to login PTT via ssh automatically.
#!/usr/bin/env expect
# Login into PTT via SSH.
# Combine crontab with this script so you don't forget to login PTT everyday.
# Usage: /bin/bash -c ${FILE_PATH_OF_THIS_SCRIPT}
# Example in crontab:
# ptt auto login, every day at 12:00 PM
# 0 12 * * * /bin/bash -c ${ABSOLUTE_FILE_PATH_OF_THIS_SCRIPT}
@santisbon
santisbon / Search my gists.md
Last active July 18, 2024 08:43
How to search gists.

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@itaysk
itaysk / prepull.yaml
Last active January 26, 2024 17:37
Kubernetes: Pre-pull images into node (moved to: https://github.com/itaysk/kube-imagepuller )
###
# There's a newer version available here:
# https://github.com/itaysk/kube-imagepuller
# All future updates will be made there.
# Please also post you questions as issues on that repo instead of commenting here
###
apiVersion: apps/v1beta2
kind: DaemonSet