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 React, { createRef } from "react"; | |
| import ReactDOM from "react-dom"; | |
| export default class Frame extends React.Component { | |
| constructor(props) { | |
| super(props) | |
| this.ref = createRef() | |
| } | |
| render() { | |
| return <iframe ref={this.ref}></iframe> |
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 { accessSync, promises as fs } from 'fs'; | |
| (async()=>{ | |
| const input = await fs.readFile("./interpretertests/aoc_21_13_input.txt", 'utf8') | |
| const p = (grid) => { | |
| for (let y = 0; y < grid.length; y++) { | |
| console.log(grid[y].map(x=>x==0?'.':'#').join('')) |
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 { accessSync, promises as fs } from 'fs'; | |
| (async()=>{ | |
| const input = await fs.readFile("./interpretertests/aoc_21_7_input.txt", 'utf8') | |
| const positions = input.split('\n')[0].split(',').map(Number) | |
| const max = Math.max(...positions) |
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 { timeStamp } from 'console'; | |
| import { accessSync, promises as fs } from 'fs'; | |
| (async()=>{ | |
| const input = await fs.readFile("./interpretertests/aoc_21_6_input.txt", 'utf8') | |
| const f = (days) => { | |
| const timers = input.split(',').map(Number) | |
| let days8 = timers.map(t=>[1, t]) |
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 { accessSync, promises as fs } from 'fs'; | |
| (async()=>{ | |
| const input = await fs.readFile("./interpretertests/aoc_21_2_input.txt", 'utf8') | |
| const result = input.split('\n').reduce((acc, line) => { | |
| let [cmd, i] = line.split(' ') | |
| i = parseInt(i) | |
| switch(cmd) { |
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 { accessSync, promises as fs } from 'fs'; | |
| (async()=>{ | |
| const input = await fs.readFile("./interpretertests/aoc_21_5_input.txt", 'utf8') | |
| const drawing = (straight) => input.split('\n').reduce((acc, line) => { | |
| let [[x1,y1],[x2,y2]] = line.split(' -> ').map(x => x.split(',').map(x => parseInt(x))) | |
| if (straight && x1!=x2 && y1!=y2) return acc |
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 { accessSync, promises as fs } from 'fs'; | |
| (async()=>{ | |
| const input = await fs.readFile("./interpretertests/aoc_21_4_input.txt", 'utf8')+'\n' | |
| const lines = input.split('\n') | |
| const draw = lines[0].split(',').map(Number) | |
| const boards = lines.slice(1).reduce((acc, line)=>{ | |
| if (line.trim().length==0) { |
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 express = require('express') | |
| const app = express() | |
| const port = 3000 | |
| const fs = require('fs') | |
| const TelegramBot = require('node-telegram-bot-api') | |
| const token = '<<<< PUT BOT TOKEN HERE >>>>>' | |
| const bot = new TelegramBot(token, {polling: true}) |
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 googlemaps | |
| gmaps = googlemaps.Client(key='YOUR_KEY') | |
| test = gmaps.find_place('nice company', 'textquery') | |
| if 'candidates' in test and len(test['candidates'])>0: | |
| first = test['candidates'][0]['place_id'] | |
| details = gmaps.place(first) |
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 | |
| $p = -1; | |
| $intr = 2; | |
| @minute = (); | |
| while(1) { | |
| $c = `find ./scraped -size +3k -ls|wc -l`; | |
| chomp($c); | |
| if ($p>=0) { | |
| $t = $c - $p; |