Skip to content

Instantly share code, notes, and snippets.

View xnuk's full-sized avatar
🏳️‍🌈
pride

즈눅 xnuk

🏳️‍🌈
pride
View GitHub Profile
import { readFileSync, writeFileSync } from 'fs'
import { parse, HTMLElement, TextNode } from 'node-html-parser'
// import { CssSelectorParser } from 'css-selector-parser'
const zipWith = <A, B, T>(a: A[], b: B[], func: (a: A, b: B) => T): T[] =>
Array.from({length: a.length > b.length ? b.length : a.length}, (_, i) => func(a[i], b[i]))
// const parser = new CssSelectorParser()
// .registerSelectorPseudos('not', 'has', 'host', 'host-context', 'is', 'where')
// .registerAttrEqualityMods('^', '*', '~', '$')
const axios = require('axios')
const {stringify} = require('querystring')
const trace = v => {
console.log(v)
return v
}
const searchMethod = (from, to) => from.includes(to)
set = Set.new ["HEAD"]
process = Process.new "git", args: [
"for-each-ref",
"--count=100",
"--sort=-committerdate",
"refs/",
"--format=%(refname:short)",
"--no-merged=HEAD"
], output: Process::Redirect::Pipe
#!/usr/bin/perl
use strict;
use warnings;
use v5.24;
use File::Temp qw/tempdir/;
use File::Basename qw/basename/;
use File::Spec::Functions qw/catfile/;
my ($filename) = @ARGV;
const fs = require('fs')
const file = path => new Promise((res, err) => {
fs.open(path, 'r', (e, fd) => {
if(e != null) return err(e)
const b = Buffer.alloc(24)
fs.read(fd, b, 0, 24, 0, (e, _, buf) => {
fs.close(fd, () => {})
if(e == null) res(buf)
else err(e)
package main
import (
"os"
"fmt"
"strings"
"io/ioutil"
yaml "gopkg.in/yaml.v2"
)
const startBufferLength = 0x20
const startBuffer = Buffer.from([
0x42, 0x4d, // magic ('BM')
0x00, 0x00, 0x00, 0x00, // length -- @2
0x00, 0x00, 0x00, 0x00, // should be [0u16, 0u16].
startBufferLength, 0x00, 0x00, 0x00, // offset
// dib
0x0c, 0x00, 0x00, 0x00, // dib length
0x00, 0x00, // width -- @18
const {parse, SELECTOR, DATA, CONVERT} = require('crawl-it')
const http = require('http')
const httpGet = (url, cb) => http.get(url, res => {
if(res.statusCode !== 200) return;
res.setEncoding('utf8')
let body = ''
res.on('data', ch => body += ch)
res.on('end', () => cb(body))
@seojmin811
@meowmeow666bark
@Lucianojgf123
@bikiechick
@julmartz1997
@MWhiteaway
@AO787LP
@mehmetaferin
@Starlove1225
@jung92814
{-# LANGUAGE OverloadedStrings, OverloadedLists, FlexibleInstances #-}
module Http2 (request) where
import Prelude hiding (reverse, null, drop, length, foldr)
import "http2-client" Network.HTTP2.Client
( StreamEvent(..)
, Http2Stream(_rst, _waitEvent)
, IncomingFlowControl(_addCredit, _consumeCredit, _updateWindow)
, StreamDefinition(StreamDefinition)
, newHttp2FrameConnection, runHttp2Client, withHttp2Stream