This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # setproxy.sh - 设置 macOS 当前 WiFi 的代理 | |
| # 用法: | |
| # ./setproxy.sh local # 设置 127.0.0.1:7890 | |
| # ./setproxy.sh snail # 设置 192.168.1.2:7890 | |
| # ./setproxy.sh close # 关闭代理 | |
| set -e | |
| # 根据参数设置代理地址 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HTTP/1.1 200 Connection established | |
| HTTP/2 200 | |
| date: Thu, 04 May 2023 08:23:18 GMT | |
| content-type: text/event-stream | |
| access-control-allow-origin: * | |
| cache-control: no-cache, must-revalidate | |
| openai-model: gpt-3.5-turbo-0301 | |
| openai-organization: user-lfzgwo6e1z7v3qr5xxxx | |
| openai-processing-ms: 633 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "messages" : [ | |
| { | |
| "content" : "翻译 string", | |
| "role" : "user" | |
| }, | |
| { | |
| "content" : "从1数到40", | |
| "role" : "user" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| var obj = null; | |
| var listener = null; | |
| function getObj() { | |
| return obj; | |
| } | |
| function setListener(l) { | |
| listener = l; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Detail() { | |
| const [x, addOneToX] = React.useReducer(x=>x+1,0); | |
| const [, forceUpdate] = React.useReducer(x=>x+1,0); | |
| console.log('render: ', x); | |
| React.useEffect(() => { | |
| console.log('effect: ', x); | |
| return function() { | |
| console.log('cleanup: ', x); | |
| } | |
| }, [x]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| initJpush() { | |
| const navigation = this.refs.app_root_nav._navigation; | |
| console.log("navigation", navigation); | |
| // 新版本必需写回调函数 | |
| if (!isIos) { | |
| JPushModule.notifyJSDidLoad((resultCode) => { | |
| if (resultCode === 0) { | |
| console.log(resultCode) | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Demo extends React.Component { | |
| state = { | |
| data: [], | |
| refreshing: true, | |
| last_id: 0, | |
| } | |
| onEndReachedCalledDuringMomentum = true | |
| componentDidMount() { | |
| this._refreshData(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name GoogleSearchFilter | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description filter google search! | |
| // @author FaiChou | |
| // @match https://www.google.com/search* | |
| // @grant none | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import '../styles/swiper.css'; | |
| function coroutine(f) { | |
| const o = f(); // instantiate the coroutine | |
| o.next(); // execute until the first yield | |
| return function(x) { | |
| o.next(x); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // FaiChou | |
| // willMount add | |
| // willUnmount remove | |
| const __notices = []; // eslint-disable-line | |
| const isDebug = true; | |
| // register notification,name: notification name,selector: function for action to do,observer: type Object | |
| export const addNotification = (name, selector, observer) => { |
NewerOlder