Skip to content

Instantly share code, notes, and snippets.

View jeasonstudio's full-sized avatar
:octocat:
Focusing

Jeason jeasonstudio

:octocat:
Focusing
View GitHub Profile
Throughout our conversation, always start your responses with "{" and end with "}", ensuring the output is a concise JSON object describing tasks with "title" and "date" properties, based on the task description provided. Calculate "date" from the current date mentioned and strictly avoid including any comments, notes, explanations, or examples in your output.
Current Date: 23/02/2024
For instance, if the task is "Prepare quarterly budget report by next Friday," your response should immediately begin with "{" and strictly end with "}", following the format: {"title": "Prepare quarterly budget report", "date": "02/03/2024"}
Adhere to this format for all task-related queries moving forward.
@jeasonstudio
jeasonstudio / deploy.js
Created October 27, 2023 07:17
Deploy on scroll mainnet
// 切换到 Scroll Mainnet (0x82750)
// 或者是 Scroll Sepolia Testnet(0x8274f)
await ethereum.request({
method: 'wallet_switchEthereumChain',
params: [{ chainId: '0x82750' }],
});
// 连接钱包(选择有余额的账户)
const [address] = await ethereum.request({ method: 'eth_requestAccounts' });
@noobnooc
noobnooc / cloudflare-worker-proxy.js
Last active October 3, 2024 11:42
cloudflare-worker-proxy
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
@sindresorhus
sindresorhus / esm-package.md
Last active November 17, 2024 22:07
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@tannerlinsley
tannerlinsley / Counter.js
Last active July 8, 2024 07:06
Global React State with Context and Immer
import { useCount, useIncrement, useDecrement } from './store.Count'
export default function Counter () {
const count = useCount()
const increment = useIncrement()
const decrement = useDecrement()
return (
<div>
<div>Count: {count}</div>
@justinfagnani
justinfagnani / mixins.md
Last active April 13, 2022 12:14
Maximally Minimal Mixins
@jeasonstudio
jeasonstudio / ustb_login.sh
Last active May 15, 2019 08:17
校园网登录脚本
#!/bin/bash
# Your StuNo. & Password
username='00000000'
password='00000000'
curl --retry 3 --data "DDDDD=${username}&upass=${password}&0MKKey=123456789" http://202.204.48.66 --silent -o LOGIN_STATUS.out
echo "Login Success!!"
@jeasonstudio
jeasonstudio / colorFormat.go
Created February 10, 2017 07:48
ColorFormat RGBA to Hexadecimal
package main
import (
"fmt"
"image"
"image/color"
)
func ColorFormat(color color.Color) string {
thisR, thisG, thisB, _ := color.RGBA()
@colemanw
colemanw / font-awesome-mime-type-icons.php
Last active July 23, 2024 10:06 — forked from guedressel/font-awesome-mime-type-icons.php
Font Awesome File Icons: Mapping MIME Types to correct icon classes
<?php
/**
* Get font awesome file icon class for specific MIME Type
* @see https://gist.github.com/guedressel/0daa170c0fde65ce5551
*
*/
function ($mime_type) {
// List of official MIME Types: http://www.iana.org/assignments/media-types/media-types.xhtml
$icon_classes = array(