javascript:(()=>{let s=x=>x.replace(/([^\\]|^)\n/,'$1 \n').replace('<','<').replace('>','>'),f=e=>(({'#text':e=>s(e.textContent),DIV:g('\n\n'),P:g(''),OL:e=>[...e.childNodes].map((x,i)=>`${i+(e.start??1)}. ${f(x).replace(/\n/,'\n '+' '.repeat(`${i}`.length))}`).join('\n'),UL:e=>[...e.childNodes].map(x=>`- ${f(x).replace(/\n/,'\n ')}`).join('\n'),LI:g(''),TABLE:e=>`|${[...e.querySelectorAll('thead th')].map(f).join('|')}|\n|${[...e.querySelectorAll('thead th')].map(x=>'---').join('|')}|\n`+[...e.querySelectorAll('tbody tr')].map(x=>`|${[...x.children].map(g('')).join('|')}|`).join('\n'),PRE:e=>'```'+e.querySelector('.hljs').className.replace(/^.*language-(\S+).*$/,'$1')+'\n'+e.querySelector('.hljs').innerText.replace(/([^\n])$/,'$1\n')+'```',CODE:e=>'`'+e.innerText+'`',STRONG:e=>`**${g('')(e)}**`,EM:e=>`_${g('')(e)}_`,DEL:e=>`<del>${g('')(e)}</del>`,IMG:e=>`![${e.alt}](${e.src})`})[e.nodeName]??(e=>s(e.innerText)))(e),g=j=>e=>[...e.childNodes].map(f).join
This is just a experimental code. Not for practical use.
More useful version is on macrat/askgpt.vim.
-
Place
autoload-chatgpt.vim
to~/.vim/autoload/chatgpt.vim
. -
Write this to your vimrc:
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 path = require('path'); | |
const {promises: fs} = require('fs'); | |
const Jimp = require('jimp'); | |
const imageminMozjpeg = require('imagemin-mozjpeg'); | |
const imageminWebp = require('imagemin-webp'); | |
const imageminZopfli = require('imagemin-zopfli'); | |
const Sharp = require('sharp'); | |
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 random | |
import itertools | |
SIZES = tuple(random.randint(0, 10) for i in range(200)) | |
TARGET = 100 | |
GENOM_NUM = 100 | |
MUTATION_NUM = 10 | |
MAX_LOOP = 100 |
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
function flattenvim() { | |
if [ "${VIM_SERVERNAME}" != "" ]; then | |
\vim --servername ${VIM_SERVERNAME} --remote $* | |
else | |
\vim --servername "$(head -c 12 /dev/random | base64)" $* | |
fi | |
} | |
alias vi=flattenvim | |
alias vim=flattenvim |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
package main | |
import ( | |
"image" | |
"image/color" | |
"image/png" | |
"os" | |
"golang.org/x/image/font" | |
"golang.org/x/image/font/basicfont" |
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
param( | |
[parameter(Mandatory, Position=0, ParameterSetName="Normal")] | |
[Int]$Number, | |
[parameter(ParameterSetName="Normal")] | |
[String]$OutputPath = "out.txt", | |
[parameter(ParameterSetName="Test")] | |
[switch]$Test = $false | |
) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlackColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMS | |
AAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGmCwwXGxwjVSRudWxs1Q0ODxAR | |
EhMUFRZcTlNDb21wb25lbnRzVU5TUkdCXE5TQ29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29s | |
b3JTcGFjZVYkY2xhc3NPECgwLjAyNzQ1MTAwNjcgMC4yMTE3NjQ3MjMxIDAuMjU4ODIz |
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
#include <stdio.h> | |
#include <stdint.h> | |
int main() { | |
for (uint32_t i=1; i<=30; i++) { | |
uint64_t x = 8825495485607995750u - (i%3>0) * (8825495483553149956u - (((i/10+12336+(i%10<<8))>>(8*(i<10))) - 9621248592211244386u) * (i%5>0)) - 8825495483553153024u*(i%5>0); | |
puts((char*)&x); | |
} | |
} |
NewerOlder