This file contains 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
/// zlib crc32 combine implementation | |
/// Usage: | |
/// | |
/// CRC32().combine(checksum1, checksum2, length2); // length of part behind checksum2 | |
/// | |
class CRC32 { | |
List<int> x2ntable = List<int>.filled(32, 0); | |
CRC32() { | |
int n, p; |
This file contains 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 mv(steps) { | |
for (var i = 0; i < steps; i++) { | |
MoveForward() | |
} | |
} | |
function tl() { | |
TurnLeft() | |
} |
This file contains 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
#!/bin/bash | |
VSCODE_OSX_LINK="https://code.visualstudio.com/sha/download?build=stable&os=darwin-universal" | |
VSCODE_OSXARM_LINK="https://code.visualstudio.com/sha/download?build=stable&os=darwin-arm64" | |
VSCODE_LINUX_LINK="https://code.visualstudio.com/sha/download?build=stable&os=linux-x64" | |
VSCODE_WIN_LINK="https://code.visualstudio.com/sha/download?build=stable&os=win32-x64-archive" | |
VSCODE_OSX_PATH=downloads/vscode-macos-x64 | |
VSCODE_OSXARM_PATH=downloads/vscode-macos-arm | |
VSCODE_LINUX_PATH=downloads/vscode-linux-x64 |
This file contains 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
############################################## | |
# Windows Store Analytics to Plausible Event # | |
# Author: Bostrot # | |
############################################## | |
from typing import Text | |
import requests | |
import json | |
urlRequestToken = 'https://login.microsoftonline.com/TENANT_ID/oauth2/token' |
This file contains 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
# Run this daily with cron | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
import telegram_send | |
import time | |
chrome_options = Options() | |
chrome_options.add_argument('--headless') | |
chrome_options.add_argument('--no-sandbox') |
This file contains 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
### | |
# FH Aachen Selenium Grade Checker with Telegram Send for notifications | |
# Description: Setup telegram-send first with pip3 install telegram_send and then in bash: telegram-send --configure | |
# Automate with cron e.g.: crontab -e and enter 0 */12 * * * /usr/bin/python3 /path/to/check_grades.py For every 12h. | |
# Author: Eric Trenkel (@bostrot) | |
# License: MIT | |
### | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options |
This file contains 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 <iostream> | |
#include <fstream> | |
#include <filesystem> | |
#include <string> | |
namespace fs = std::filesystem; | |
int main() { | |
std::ofstream out("./cpp_snippets.md"); | |
std::string current = ""; |
This file contains 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 <iostream> | |
std::string exec(std::string cmd) { | |
std::string data; | |
FILE * stream; | |
const int max_buffer = 256; | |
char buffer[max_buffer]; | |
cmd.append(" 2>&1"); | |
stream = popen(cmd.c_str(), "r"); |
This file contains 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
int button[5]; | |
bool curPressed[5]; | |
bool pressedD = false; | |
bool pressedM = false; | |
void setup() | |
{ | |
Serial.begin(38400); | |
} | |
void loop() |
This file contains 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 config = require('../config.js'); | |
const cache = require('./cache.js'); | |
function ticketHandler(bot, ctx) { | |
ctx.getChat().then(function(chat) { | |
if (chat.id.toString() === config.staffchat_id) { | |
// let staff handle that | |
staffChat(ctx, bot, chat); | |
} else if (chat.type === 'private') { | |
// create a ticket and send to staff |
NewerOlder