Skip to content

Instantly share code, notes, and snippets.

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

Saren Arterius Saren-Arterius

💭
(^^)
View GitHub Profile
@Saren-Arterius
Saren-Arterius / gist:b26fa2ff529f3f339b31d84f09375d5b
Last active April 16, 2016 13:59
Code Jam 2016 Round 1A Q3 BFFs (10% Incorrect solution)
#!/usr/bin/env python3
"""
Failed in this case, does not know why.
1
6
2 3 2 5 4 3
"""
FORMAT = "Case #{}: {}"
@Saren-Arterius
Saren-Arterius / ubm-solver.py
Last active July 1, 2019 14:29
Unblock Me solver
#!/usr/bin/env python3
# An Unblock Me solver written using A* search algorithm
# perfect solution
# Author: Saren
SIZE = 6
"""
GOAL = (
(' ', ' ', ' ', ' ', ' ', ' '),
(' ', ' ', ' ', ' ', ' ', ' '),
(' ', ' ', ' ', ' ', 'T', 'G'),
<#
.SYNOPSIS
MSI-mode utility
.DESCRIPTION
Main purpose of this script is turning on MSI-mode for all PCI devices in bulk. Script offers four modes which can be selected through following command line arguments:
'on' - turning MSI-mode on;
'off' - turning MSI-mode off;
'reg' - printing reg-file for backup purposes (to save text to reg-file use standard redirection or piplining to comandlet Out-File);
- started without command line argument script prints devices capable for MSI-mode.
powershell %UserProfile%\Desktop\msi.ps1 on
#!/usr/bin/env python2
# Problem: http://9gag.com/gag/a6Qq368?ref=fb.s
# sudo pip2 install python-constraint
from constraint import *
variables = "a", "b", "c"
problem = Problem()
for v in variables:
problem.addVariable(v, range(10))
problem.addConstraint(AllDifferentConstraint())
problem.addConstraint(FunctionConstraint(lambda a, b, c: (a == 5) + (b == 4) + (c == 8) == 1), variables)
@Saren-Arterius
Saren-Arterius / FourInALine.java
Created November 13, 2016 09:21
ITP3914 Four-in-a-Line
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class FourInALine {
public static final Scanner scanner = new Scanner(System.in);
public static final int WIN_MIN_LENGTH = 4;
public static final int ROW_COUNT = 6;
public static final int COLUMN_COUNT = 7;
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'
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
@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
@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 = [
(