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 { 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('^', '*', '~', '$') |
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
const axios = require('axios') | |
const {stringify} = require('querystring') | |
const trace = v => { | |
console.log(v) | |
return v | |
} | |
const searchMethod = (from, to) => from.includes(to) |
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
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 |
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
#!/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; |
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
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) |
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
package main | |
import ( | |
"os" | |
"fmt" | |
"strings" | |
"io/ioutil" | |
yaml "gopkg.in/yaml.v2" | |
) |
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
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 |
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
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)) |
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
@seojmin811 | |
@meowmeow666bark | |
@Lucianojgf123 | |
@bikiechick | |
@julmartz1997 | |
@MWhiteaway | |
@AO787LP | |
@mehmetaferin | |
@Starlove1225 | |
@jung92814 |
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
{-# 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 |