Skip to content

Instantly share code, notes, and snippets.

Avatar
🎓
Studying from home

Yannic Wehner ElCap1tan

🎓
Studying from home
View GitHub Profile
@ElCap1tan
ElCap1tan / lock.sh
Last active Jan 22, 2021
Simple blur lock screen that works with i3lock, xsslock, scrot and ImageMagick
View lock.sh
#!/bin/bash
## CONFIGURATION ##############################################################
# Options to pass to i3lock
i3lock_options="-d"
TMPBG=/tmp/screen.png
MUTED=""
# Run before starting the locker
pre_lock() {
@ElCap1tan
ElCap1tan / client.go
Last active Aug 10, 2020
[Go] Simple example of how to use sockets for a basic, multithreaded, TCP based client-server communication.
View client.go
package main
import (
"bufio"
"fmt"
"net"
"os"
"strings"
)
@ElCap1tan
ElCap1tan / Main.java
Last active Nov 22, 2019
Bruch als Objekt
View Main.java
public class Main {
public static void main(String[] args) {
Bruch b = null;
Bruch b2 = null;
try {
b = new Bruch(18,36);
b2 = new Bruch(13, 24);
}
@ElCap1tan
ElCap1tan / fischer-yates.cs
Last active Oct 13, 2019
C# Implementation of the Fischer-Yates shuffle
View fischer-yates.cs
using System;
namespace Fisher_Yates_shuffle
{
class Program
{
static void Main(string[] args)
{
// Generate a set of numbers from user input...
Console.Write("Enter count of numbers to shuffle: ");
@ElCap1tan
ElCap1tan / main.py
Last active Sep 17, 2019
Student Credits Management
View main.py
from student_register import StudentRegister
from student import Student
def main():
register = StudentRegister("Bachelor CS 2019")
napoleon = Student('Napoleon', 1, 20)
snowball = Student('Snowball', 2, 22)
squealer = Student('Squealer', 3, 19)
@ElCap1tan
ElCap1tan / progress_printer.py
Last active Nov 1, 2019
Simple and leightweight multi-threaded port scanner written in python that can work with port and ip address ranges. At the moment this script only supports full-connection tcp scans. For usage help see >python pyscan.py -h
View progress_printer.py
import sys
class ProgressPrinter:
def __init__(self, units, unit_type='', max_length=50, pre='', post='', fill='=', head='>', empty=' '):
if units > max_length:
self.steps = max_length / units
self.max_length = max_length
else:
self.steps = 1
@ElCap1tan
ElCap1tan / hash.py
Created Aug 15, 2019
Hash a string from console input
View hash.py
import hashlib
def hash_word(string, hash_method):
if hash_method == "md5":
return hashlib.md5(string.encode()).hexdigest()
if hash_method == "sha3_256":
return hashlib.sha3_256(string.encode()).hexdigest()
@ElCap1tan
ElCap1tan / hangman.py
Last active Aug 15, 2019
Simple text based Hangman game for the console in python
View hangman.py
class Hangman:
def __init__(self):
self.stages = []
self.stages.append("""
___________.._______
| .__________))______|
| | / / ||
| |/ / ||
@ElCap1tan
ElCap1tan / accountmenu.layout
Created Jul 25, 2018
resource/layout/accountmenu.layout
View accountmenu.layout
"resource/layout/accountmenu.layout"
{
styles
{
AccountMenuStyle
{
render_bg
{
// top area and graphic
0="fill( x0, y0, x1, y1, customgreyprimary)"
@ElCap1tan
ElCap1tan / accountbutton.layout
Created Jul 25, 2018
resource/layout/accountbutton.layout
View accountbutton.layout
"resource/layout/accountbutton.layout"
{
styles
{
AccountPersonaStyleOffline
{
padding-right=6
padding-left=12
textcolor=Friends.OfflineColor
}