Skip to content

Instantly share code, notes, and snippets.

const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
devtools: true,
//slowMo: 850 // slow down by 250ms
});
const page = await browser.newPage();
await page.goto('https://www.instagram.com/hackaberry/?hl=de');
{
"$id": "#/definitions/ibans",
"type": "array",
"title": "Ibans",
"description": "ibans description",
"items": {
"$id": "#/definitions/ibans/items",
"type": "string",
"title": "Ibans_item",
"description": "ibans_item description",
{
"thumbnail_src": {
"type": "string",
"title": "Thumbnail_src",
"description": "thumbnail_src description",
"maxLength": 200,
"format": "uri"
},
"media_preview": {
"type": "string",
// sample JSON input:
let input = { "ibans": [ "DE64500105178934265111", "DE24500165174934165222" ] }
// generated JSON-Schema output:
let generated_schema = {
"ibans": {
"$id": "#/definitions/ibans",
"type": "array",
"title": "Ibans",
"description": "ibans description",
{
"type": "object",
"properties": {
"age": {
"type": "integer",
"title": "Age"
},
"items": {
"type": "array",
"items": {
@temp3l
temp3l / card.json
Created September 30, 2020 22:31
{
"credit_card": {
"$id": "#/properties/credit_card",
"$comment": "Comment for developer",
"type": "string",
"title": "credit card number",
"description": "The number on the back of this credit card",
"examples": [ "4111 1111 1111 1111", "5500 0000 0000 0004" ],
"default": "4111 1111 1111 1111",
"minLength": 10,
@temp3l
temp3l / ripgrep_sample.sh
Last active August 19, 2020 17:04
ripgrep
# brew install ripgrep
# 1. You want to find all strings matching "console.log" in your ~/workspace folder.
# 2. You dont want to search inside .git or node_modules folders.
# 3. Ignore-case but search inside zip-files
# quicky:
rg 'console\.log' ~/workspace
# advanced:
@temp3l
temp3l / concurrent.sh
Last active July 31, 2020 19:17
multithreaded split file with sed
#!/bin/bash
worker=8
args=("$@")
file=${args[0]}
lines=$(wc -l $file | awk -F ' ' '{print $1}')
linesPerWorker=$(expr $lines / $worker)
start=1
mkdir -p tmp
// just guessing
// converted: https://json-schema.org/draft/2019-09/links
export type JSONSchema7 = import('json-schema').JSONSchema7;
export type LinkDescriptionObject = {
anchor?: string;
anchorPointer?: string;
rel?: string | string[];
href?: string;