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
#!/usr/bin/python | |
import subprocess | |
import socket | |
import time as t | |
service = "cronixx.ddns.net" | |
port = 30841 | |
token = "123" | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
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
def convert_to_base(input, outputbase): | |
output = [] | |
next_number = input | |
while next_number > 0: | |
print("NextNumber: {0} | Base: {1} --> Next_number = {2} Rest = {3}".format(next_number, | |
outputbase, | |
int(next_number/outputbase), | |
int(next_number % outputbase))) |
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
def PromptUser(prompt): | |
yield input(prompt) | |
def LoopGen(gen, *args, **kwargs): | |
while True: | |
for item in gen(*args, **kwargs): | |
yield item | |
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
import math | |
import numbers | |
import random | |
class Vector(object): | |
""" My pythonic vector implementation """ | |
def __init__(self, *args): | |
if len(args) == 1 and isinstance(args[0], list): |
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
def matrix_multiply(m_1, m_2): | |
assert len(m_1[0]) == len(m_2) | |
r = list(map(lambda m: sum([x * y for x, y in zip(*m)]), [(x, y) for x in m_1 for y in zip(*m_2)])) | |
return [r[x:x+len(m_2[0])] for x in range(0, len(m_1)*len(m_2[0]), len(m_2[0]))] |
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
list(map(print, map(lambda n : (chr(0x0).join(chr(x) for x in (int(n[3 * i:3 * i + 3]) for i in range(0, len(n) // 3)))), [ "104101108108111", "119111114108100" ]))) |
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
import random | |
from math import sqrt | |
import numpy as np | |
def harmonic_series(stop_after=-1): | |
""" | |
:param stop_after: | |
:return: | |
""" |
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 | |
if [ $# -lt 1 ]; then | |
selection=$(man -k . | fzf | cut -f1 -d " ") | |
if [ -z selection ]; then | |
exit | |
fi | |
if man "$var" > /dev/null 2>&1 | |
then | |
man -Tpdf "$var" | zathura - & | |
fi |
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
#!/usr/bin/env bash | |
selection=$(ls -d ~/Musik/* ~/Videos/* | fzf ) | |
cvlc "$selection" |
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
import math | |
from PIL import Image | |
import pandas as pd | |
import time | |
RESOLUTION = 10**3 | |
def get_color(escape_val): | |
return escape_val |
OlderNewer