Skip to content

Instantly share code, notes, and snippets.

View jinnosux's full-sized avatar

jinnosux

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>The Matrix</title>
<style>
* {
margin: 0;
padding: 0;
}
@jinnosux
jinnosux / entro.py
Last active June 10, 2024 11:18
entro.py
"""
Network Packets Entropy Analyzer
Author: Vahid Konicanin
Part of a Research Paper "Detecting Network Anomalies with Shannon Entropy: A Novel Approach to Cybersecurity"
International Balkan University, 2024
"""
import math
import hexdump
import dpkt
@jinnosux
jinnosux / skkrript.py
Last active December 17, 2023 00:04
NGAwards2023 vote counting script
import xlsxwriter
from collections import Counter
import re
workbook = xlsxwriter.Workbook("example.xlsx")
worksheet = workbook.add_worksheet()
categories = ['Best Cop', 'Best Paramedic',
'Best Hitman', 'Best Gunrunner', 'Best Thief',
'Best Driver', 'Best Pilot', 'Best Disappearer', 'Best Dressed Player',
@jinnosux
jinnosux / export.py
Created December 13, 2022 17:29
ng-awards-2022
import xlsxwriter
workbook = xlsxwriter.Workbook("example.xlsx")
worksheet = workbook.add_worksheet()
categories = ['Best Cop', 'Best Paramedic',
'Best Hitman', 'Best Gunrunner', 'Best Thief',
'Best Driver', 'Best Pilot', 'Best Dressed Player',
'Best Gold Rush Finder', 'Funniest Player', 'Most Helpful Player',
'Best New Player', 'Most Reformed Player', 'NG Couple', 'Server Bitch',
@jinnosux
jinnosux / timeago.dart
Created November 7, 2020 15:32
Flutter time ago implementation
String timeAgoSinceDate({bool numericDates = true}) {
DateTime date = this.createdTime.toLocal();
final date2 = DateTime.now().toLocal();
final difference = date2.difference(date);
if (difference.inSeconds < 5) {
return 'Just now';
} else if (difference.inSeconds < 60) {
return '${difference.inSeconds} seconds ago';
} else if (difference.inMinutes <= 1) {
palette="#121C21:#E44754:#89BD82:#F7BD51:#5486C0:#B77EB8:#50A5A4:#FFFFFF:#52606B:#E44754:#89BD82:#F7BD51:#5486C0:#B77EB8:#50A5A4:#FFFFFF"
foreground="#B3B8C3"
background="#121B21"
cursor="#E95420"
darkstyle="true" # true or false
gsettings set io.elementary.terminal.settings palette "$palette"
gsettings set io.elementary.terminal.settings foreground "$foreground"
gsettings set io.elementary.terminal.settings background "$background"
gsettings set io.elementary.terminal.settings cursor-color "$cursor"
@jinnosux
jinnosux / characters.csv
Created May 7, 2020 20:08
importing stuff from csv to db
name house birth
Adelaide Murton Slytherin 1982
Adrian Pucey Slytherin 1977
Anthony Goldstein Ravenclaw 1980
Blaise Zabini Slytherin 1979
Cedric Diggory Hufflepuff 1977
Cho Chang Ravenclaw 1979
Colin Creevey Gryffindor 1981
Dean Thomas Gryffindor 1980
Draco Lucius Malfoy Slytherin 1980
@jinnosux
jinnosux / mario more.py
Created May 7, 2020 20:04
Mario problemset in py
from cs50 import get_int
while True:
height = get_int("Enter height of half-pyramid: ")
if height >= 1 and height <= 8:
break
for i in range(height):
print(' ' * (height-1-i), end="")
print('#' * (i+1), end="")
@jinnosux
jinnosux / weather.py
Created May 1, 2020 12:10
Weather crawler from DarkSky
import requests
from bs4 import BeautifulSoup
#Get website with cordinates of my city ( Novi pazar
data = requests.get("https://darksky.net/forecast/43.1379,20.5124/si12/en")
soup = BeautifulSoup(data.text, "html.parser")
soup.prettify()
#Selecting specific div on website which contains elements we like to display
results=soup.find_all('span', class_='desc swap')
@jinnosux
jinnosux / PY0101EN-5-1-Numpy1D.ipynb
Created December 6, 2019 18:29
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.