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 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 / 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 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 = {
// ==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/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):
#!/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]:
@Saren-Arterius
Saren-Arterius / matches_meme_solver.py
Last active June 7, 2018 12:43
Matches meme solver
#!/usr/bin/env python3
from multiprocessing import Pool, Queue
from itertools import product
PROBLEM = ' 6008 '
DEPTH = 2
EMPTY = 0, 0, 0, 0, 0, 0, 0
DIGIT_FONTS = [
(
@Saren-Arterius
Saren-Arterius / neofetch
Created March 11, 2017 16:20
neofetch config
#!/usr/bin/env bash
#
# Neofetch config file
# https://github.com/dylanaraps/neofetch
echo
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
print_info() {
info title
zstyle ':prompt:grml:*:items:user' pre '[%F{yellow}'
zstyle ':prompt:grml:*:items:percent' pre ']'
source /etc/profile.d/alias.sh
export EDITOR=nano
export VISUAL=nano
alias sta='sudo systemctl start'
alias sto='sudo systemctl stop'
alias stt='sudo systemctl status'
alias rst='sudo systemctl restart'
alias enb='sudo systemctl enable'
alias dsb='sudo systemctl disable'
alias s='sudo apt install'
alias i='sudo apt install'
alias r='sudo apt remove'