Skip to content

Instantly share code, notes, and snippets.

View Saren-Arterius's full-sized avatar
💭
(^^)

Saren Arterius Saren-Arterius

💭
(^^)
View GitHub Profile
#!/usr/bin/env python3
if __name__ == '__main__':
points = set()
for _ in range(int(input())):
x, y = map(int, input().split())
points.add((x, y))
rects = []
for lt in points:
for rb in points:
if rb[0] <= lt[0] or rb[1] >= lt[1]:
#!/usr/bin/python3
from pyquery import PyQuery as pq
from selenium import webdriver
from operator import itemgetter
from re import sub
from datetime import datetime
from os.path import dirname, realpath
class BuyStockSession(object):
// ==UserScript==
// @name Dog Square Custom Keymap
// @version 0.1
// @description Custom keymap
// @author Saren
// @match https://tobychui.github.io/Dog-Square/
// @grant none
// @run-at document-start
// ==/UserScript==
#!/usr/bin/env python3
from constraint import *
from collections import Counter
problem = Problem()
opts = ['A', 'B', 'C', 'D']
for i in range(1, 10 + 1):
problem.addVariable(str(i), ['A', 'B', 'C', 'D'])
q2m = {
@Saren-Arterius
Saren-Arterius / ecfsmp-timer
Last active March 18, 2018 07:01
Ecryptfs mount timeout
#!/bin/bash
TIMEOUT_SECONDS=900
PRIVATE_PATH=/home/`whoami`/Private
ecryptfs-mount-private &&
while true; do
timeout ${TIMEOUT_SECONDS} inotifywait ${PRIVATE_PATH} || (echo "Timeout" && ecryptfs-umount-private && break)
t=`stat -f -c %T ${PRIVATE_PATH}`
if [[ "${t}" != "ecryptfs" ]]; then
echo "Not ecryptfs, exiting"
#!/usr/bin/env bash
#
# Neofetch config file
# https://github.com/dylanaraps/neofetch
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
print_info() {
echo
info title
@Saren-Arterius
Saren-Arterius / q2-de.py
Last active April 24, 2018 18:51
PolyU OS As
#!/usr/bin/env pypy3
from constraint import *
from collections import Counter
from itertools import combinations
problem = Problem()
requests = [60, 77, 70, 33, 99, 83, 75, 21, 77, 28, 60, 48]
request_l = len(requests)
slots = {
'A': 123,
@Saren-Arterius
Saren-Arterius / PKGBUILD
Created April 28, 2018 16:40
anbox lxc 3.0 aur patch
# Maintainer: Iwan Timmer <irtimmer@gmail.com>
pkgname=('anbox-git' 'anbox-modules-dkms-git')
_pkgname=anbox
pkgver=r735.f68725c
pkgrel=1
epoch=1
arch=('x86_64')
url="http://anbox.io/"
license=('GPL3')
#!/usr/bin/env python3
from time import sleep
CURSOR_UP_ONE = '\x1b[1A'
ERASE_LINE = '\x1b[2K'
def rf():
print(CURSOR_UP_ONE + ERASE_LINE + CURSOR_UP_ONE)
@Saren-Arterius
Saren-Arterius / index.html
Created May 14, 2018 13:42 — forked from RubaXa/index.html
String#includes vs. String#indexOf vs. RegExp (http://jsbench.github.io/#a4612afd0cd26e911ee8) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>String#includes vs. String#indexOf vs. RegExp</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>