View KOS_multiple_tabs.user.js
// ==UserScript==
// @name KOS multiple tabs
// @namespace util
// @description Allows you to use KOS in mutiple tabs.
// @include https://www.kos.cvut.cz/kos/*
// @version 1
// @grant none
// ==/UserScript==
// Name of local storage entry where page id is stored
const DATA_NAME = "KOS_PAGE_ID";
View pypy_test.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title>PyPy</title>
</head>
<body>
<h2>Select python file</h2>
<input type="file" id="files" name="file" multiple />
View main.js
/**
* Module dependencies.
*/
var express = require('express')
, graph = require('fbgraph');
var app = express();
var server = require("http").createServer(app);
View test_hw.py
# Homework tester script
# ----------------------
# This script will automatically (try to) test
# IO of your homework.
#
# Requirements:
# Python 2.7 In order to use Python 3, change `raw_input` to `input`
# gcc compiler
#
# Parameters:
View prepare.bat
@echo off
set FILETOZIP=%1
echo Selected file: %FILETOZIP%
set TEMPDIR=TMP
echo Creating temporary file directory .\%TEMPDIR%
mkdir %TEMPDIR%
copy %FILETOZIP% %TEMPDIR%\main.c
View click_left.ahk
toggle=0
F12::
If (toggle := !toggle)
SetTimer, Timer, -1
return
timer:
while toggle
{
View PromisifyReadline.js
const readline = require('readline');
var oldCreateIface = readline.createInterface;
readline.createInterface = function() {
var iface = oldCreateIface.apply(this, arguments);
var oldQuestion = iface.question;
iface.question = function(question) {
var promise = Promise.defer();
oldQuestion.call(this, question, (result)=>{
View gist:02d51981caa6f14cd825
{
"id":"0000",
"message":"TEXT",
"badWordReplacements":null,
"user":{
"id":"USER_ID",
"name":"SUMMONER_NAME",
"lolSummonerLevel":"LEVEL (0-30)",
"lolProfileIcon":"PROFILE_ICON_ID",
"realm":"NA/EUNE/EUW/OCE",
View Rect.java
/* License:
* Open source ftw. I doubt anybody would actually like to use this file.
* But if you want, use it, change it or share it under any license you like.
*/
package autoclick;
//Comment this out if you don't have the library
import com.sun.jna.platform.win32.WinDef;
//Used for exporting rect class as normal rectangle
import java.awt.Rectangle;
View rapidxml::xml_node_get_children
namespace rapidxml {
//I even managed to create it as a template, though I don't understand templates at all
template <class T>
vector<xml_node<T>*> xml_node_get_children(xml_node<T>* node, const char* filter = NULL) {
//This will be returned
vector<xml_node<T>*> children;
for (xml_node<T> *child = node->first_node(); child; child = child->next_sibling())
{
//If filter is ON, only tag name EXACT MATCHES are included
if(filter==NULL || strcmp(filter, child->name())==0)