This file contains 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
# Method 1. git http + proxy http | |
git config --global http.proxy "http://127.0.0.1:1080" | |
git config --global https.proxy "http://127.0.0.1:1080" | |
# Method 2. git http + proxy shocks | |
git config --global http.proxy "socks5://127.0.0.1:1080" | |
git config --global https.proxy "socks5://127.0.0.1:1080" | |
# to unset | |
git config --global --unset http.proxy |
This file contains 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
open -n -a 'Google Chrome' 'https://github.com/' --args --user-data-dir='/tmp/chrome_dev_0' --disable-web-security --allow-running-insecure-content |
This file contains 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, { useState } from 'react' | |
import styled from '@emotion/styled' | |
import murmur3 from '../../utils/murmurhash3_32.js' | |
const Container = styled.div` | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
flex-direction: column; | |
height: 75vh; |
This file contains 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, { Component, useRef } from 'react' | |
import styled from '@emotion/styled' | |
import { sleep } from '../../utils/schedule.js' | |
const Container = styled.div` | |
box-sizing: border-box; | |
position: relative; | |
display: flex; | |
flex-direction: column; | |
justify-content: center; |
This file contains 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, { useReducer } from 'react' | |
import styled from '@emotion/styled' | |
import { sleep } from '../../utils/schedule.js' | |
const initialState = { count: 7n } | |
function reducer(state = initialState, action) { | |
if (action.type === 'setCount') { | |
return { | |
...state, |
This file contains 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
<template> | |
<input type="text" | |
inputmode="numeric" | |
:value="editing ? value : formattedValue" | |
@focus="editing = true" | |
@blur="editing = false" | |
@input="value = $event.target.value" | |
placeholder="Enter" | |
pattern="[0-9]*"/> | |
</template> |
This file contains 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
async function getRepositoryCloneListByPage(name, page = 1) { | |
const response = await fetch(`https://api.github.com/users/${name}/repos?page=${page}`) | |
const result = await response.json() | |
return result.map((it) => { | |
return it.clone_url | |
}) | |
} | |
async function getRepositoryCloneList(name) { | |
let page = 1 |
This file contains 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
const classNameSet = new Set() | |
function getRandomClassName() { | |
const className = Math.random().toString(36).substring(2) | |
if (classNameSet.has(className)) { | |
return getRandomClassName() | |
} | |
classNameSet.add(className) | |
return `css-${className}` | |
} |
This file contains 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
var handler = (Consumer<byte[]>) (bytes) -> { | |
CompletableFuture.runAsync(() -> { | |
var readStr = new String(bytes); | |
System.out.println("readStr: " + readStr); | |
}); | |
}; | |
var inputStream = System.in; | |
var readThread = new Thread(() -> { | |
try { |
This file contains 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 xlsx from 'xlsx' | |
export function importExcelFile(file) { | |
return new Promise((resolve, reject) => { | |
function handleOnLoad(event) { | |
try { | |
const { result } = event.target; | |
const workbook = xlsx.read(result, { type: 'binary' }); | |
const sheetsData = []; | |
for (const sheet of Object.entries(workbook.Sheets)) { |
NewerOlder