Skip to content

Instantly share code, notes, and snippets.

@azu
azu / README.md
Last active September 22, 2024 09:48
Node.jsのTypeScriptサポートについて
@VictorTaelin
VictorTaelin / gpt4_abbreviations.md
Last active November 2, 2024 21:46
Notes on the GPT-4 abbreviations tweet

Notes on this tweet.

  • The screenshots were taken on different sessions.

  • The entire sessions are included on the screenshots.

  • I lost the original prompts, so I had to reconstruct them, and still managed to reproduce.

  • The "compressed" version is actually longer! Emojis and abbreviations use more tokens than common words.

@hyuki
hyuki / ChatWithChatGPT.md
Last active April 23, 2023 23:39
結城浩とChatGPTの対話

結城浩とChatGPTの対話

2022年12月2日

  • 「質問」は結城浩の文章です。
  • 「回答」はChatGPTの文章です。

質問

ChatGPTという対話するAIツールがあります。人間が質問を投げかけるとそれらしく対話して回答してくれるツールです。こういうツールに対してどんな質問を投げかけたらおもしろい対話になるでしょうかね。何かアイディアがあったら聞かせてください。具体的な質問を知りたいなあ。

@colbyfayock
colbyfayock / github-action-chrome-version.yml
Created April 20, 2021 14:39
GitHub Actions - Installing a specific version of Chrome
# Follow instructions under "Old Builds" here: https://www.chromium.org/getting-involved/download-chromium
# Add the version number in the variable below and run the step before needed
# "-1" may not show in the actual version number
steps:
- run: |
VERSION_STRING="88.0.4324.96-1"
wget "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${VERSION_STRING}_amd64.deb"
sudo dpkg -i "google-chrome-stable_${VERSION_STRING}_amd64.deb"
@mala
mala / covid19-twitter-research_01.md
Last active October 17, 2024 06:34
生活と意見: ソーシャルディスタンスなどと称してユーザー名や文章にスペースを挟む行為についての苦情

生活と意見: ソーシャルディスタンスなどと称してユーザー名や文章にスペースを挟む行為についての苦情

更新履歴

2020-05-13 追記

@kozakana
kozakana / createIndex.js
Last active December 26, 2019 14:06
js-unigram
const Document = require('./document')
const fs = require('fs')
const TOKEN_DIR = './tokens'
const DOC_DIR = './docs'
const DOC_DATA = './docs.json'
const docFiles = fs.readdirSync(DOC_DIR).filter(fileName => fileName.match(/.+\.txt$/))
const docs = {}
@btoo
btoo / usePrevious.ts
Last active September 11, 2022 15:30
typescript type-safe version of usePrevious taken directly from the react docs https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
import { useRef, useEffect } from 'react';
/**
* a type-safe version of the `usePrevious` hook described here:
* @see {@link https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state}
*/
export function usePrevious<T>(
value: T,
): ReturnType<typeof useRef<T>>['current'] {
const ref = useRef<T>();
//Class
class InputWithFocus extends React.Component {
constructor() {
super();
this.inputRef = null;
}
render() {
return <div>
<input ref={inputRef => { this.inputRef = inputRef }} />
<button onClick={() => this.inputRef.focus()}>
//Class
componentWillReceiveProps(nextProps) {
if (nextProps.count !== this.props.count) {
console.log('count changed', nextProps.count);
}
}
//Hooks
//Printing 1st iteration:
useEffect(() => {
@jamesreggio
jamesreggio / react-forwardref-simple-example.js
Last active September 21, 2024 06:31
Simple example usage of React.forwardRef()
// EmailInput wraps an HTML `input` and adds some app-specific styling.
const EmailInput = React.forwardRef((props, ref) => (
<input ref={ref} {...props} type="email" className="AppEmailInput" />
));
class App extends Component {
emailRef = React.createRef();
render() {
return (