Skip to content

Instantly share code, notes, and snippets.

View x3388638's full-sized avatar
:octocat:

YY Chang x3388638

:octocat:
View GitHub Profile
@bradtraversy
bradtraversy / tailwind-webpack-setup.md
Last active November 26, 2024 04:24
Setup Webpack with Tailwind CSS

Webpack & Tailwind CSS Setup

Create your package.json

npm init -y

Create your src folder

Create a folder called src and add an empty index.js file. The code that webpack compiles goes in here including any Javascript modules and the main Tailwind file.

@x3388638
x3388638 / HistoryLogger.user.js
Created January 21, 2021 08:16
Log all pushState and replaceState events in console
// ==UserScript==
// @name HistoryLogger
// @namespace 2yc.tw
// @version 0.1
// @description Log all pushState and replaceState events in console
// @author YY
// @match *://*/*
// @grant none
// ==/UserScript==
@gunn
gunn / frame.tsx
Last active May 4, 2023 15:47
Render react content in an iframe
import * as React from 'react'
import { createPortal } from 'react-dom'
type FrameProps = React.IframeHTMLAttributes<HTMLIFrameElement> & {
head?: React.ComponentType<any>
children?: React.ReactNode
}
const Frame = React.memo(({head, children, ...iframeProps}: FrameProps)=> {
const node = React.useRef<HTMLIFrameElement>()
const [doc, setDoc] = React.useState<Document>()
@x3388638
x3388638 / RO_Seal_Auto.user.js
Last active December 20, 2017 18:46
仙境傳說 守護永的愛 RO 耶誕城揪伴裝飾你的聖誕樹 全自動拿序號 (Doc: https://hackmd.io/s/B1pB-7j-z)
// ==UserScript==
// @name RO_Seal_Auto.user.js
// @namespace YY
// @version 2.0
// @description RO Seal, auto get code
// @author Y.Y.
// @include /https:\/\/rom\.gnjoy\.com\.tw\/.*/
// @include /https://www.wegames.com.tw/site/login/
// @exclude https://rom.gnjoy.com.tw/fblike/getgift
// @grant none
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active June 18, 2024 11:27
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
// ==UserScript==
// @name pkget crawler
// @namespace crawlPKGET
// @version 2.1
// @description Pokemon is over there.
// @author Y.Y.
// @match https://pkget.com/*
// @include https://pkget.com/*
// @grant none
// ==/UserScript==
@x3388638
x3388638 / NCNUCourseCrawler.js
Created June 4, 2016 15:47
NCNU Course Crawler
window.NCNUCourseCrawler = (_ => {
const recperpage = 600;
const COURSE_NUM = 1376;
const PAGES = Math.ceil(COURSE_NUM / recperpage);
const YEAR = 1042;
let courseList = [];
function start() {
_getCourseList();
courseList.forEach((val, i) => {
@d2s
d2s / installing-node-with-nvm.md
Last active October 20, 2024 13:06
Installing Node.js to Linux & macOS & WSL with nvm

Installing Node.js with nvm to Linux & macOS & WSL

A quick guide on how to setup Node.js development environment.

Install nvm for managing Node.js versions

nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.

  1. Open new Terminal window.