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
| #include <Servo.h> | |
| void setup() { | |
| // put your setup code here, to run once: | |
| Serial.begin(9600); | |
| pinMode(LED_BUILTIN, OUTPUT); | |
| digitalWrite(LED_BUILTIN, HIGH); | |
| } | |
| void loop() { |
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
| let main = ["vanilja", "mansikka", "sulkaa", "päärynä"]; | |
| let sub = ["sulkaa", "kinuski"]; | |
| let tree = {}; | |
| main.forEach(item => { | |
| tree[item] = sub; | |
| }) |
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
| /* | |
| * Copyright (c) 2021 wilmaplus-notifier2, developed by @developerfromjokela, for Wilma Plus mobile app | |
| */ | |
| export class AsyncIterator<T> { | |
| currentItem = -1 | |
| items: T[] | |
| callback:(item: T, iterator: AsyncIterator<T>) => void; | |
| endCallback:() => void; |
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
| function uuidv4() { | |
| return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
| var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); | |
| return v.toString(16); | |
| }); | |
| } | |
| function sha256(content) { | |
| return CryptoJS.enc.Hex.stringify(CryptoJS.SHA256(content)); |
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
| class AsyncIterator { | |
| constructor(callback, endCallback, items) { | |
| this.currentItem = -1; | |
| this.items = items; | |
| this._callback = callback; | |
| this._endCallback = endCallback; | |
| } |
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 requests | |
| import urllib.parse as urlparse | |
| import validators | |
| import bs4 | |
| def meta_redirect(content): | |
| soup = bs4.BeautifulSoup(content, 'html.parser') | |
| result = soup.find("meta", attrs={"http-equiv": "Refresh"}) |
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 argparse | |
| from io import BytesIO | |
| import requests | |
| import uuid | |
| import exifread as ef | |
| import json | |
| class bcolors: | |
| HEADER = '\033[95m' |
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
| https://api.ellibs.com/v1.3/json/patronAuth/app12480 | |
| https://api.ellibs.com/v1.3/json/listCollections/app12480 | |
| Auth: Basic (app12480:ZWXqi30gc78ifBcrTf9uSasw6dSWwFt7itsYPkbwa3Lq) | |
| Login POST: | |
| id: library id | |
| patron_id: library card number | |
| password: pin-code or password |