Skip to content

Instantly share code, notes, and snippets.

View Der-Eddy's full-sized avatar

Eduard Der-Eddy

View GitHub Profile
import os
import platform
import requests
oauthURL = 'https://anilist.co/api/v2/oauth/authorize?client_id=XXXX\&response_type=code'
api = 'https://graphql.anilist.co'
headers = {'user-agent': platform.system().lower() + ':anicli:v.1.0', 'Content-Type': 'application/json', 'Accept': 'application/json'}
accessToken = 'def50200a9891a ... currently hard coded for testing purposes'

Keybase proof

I hereby claim:

  • I am der-eddy on github.
  • I am dereddy (https://keybase.io/dereddy) on keybase.
  • I have a public key ASA9n5hZWqWbsAkIJdCyamimlWAfptJpdZuEIpVohknezgo

To claim this, I am signing this object:

@Der-Eddy
Der-Eddy / sort.py
Created January 19, 2018 16:43
Paragraph Sorter
from tkinter import *
def sortText():
text = T.get(1.0, END)[:-2]
lst = text.split('\n\n')
lst.sort()
print(lst)
T.delete(1.0, END)
T.insert(END, '\n\n'.join(lst))
geheimnis = 1337
versuch = 0
zaehler = 0
while versuch != geheimnis:
versuch = int(input("Raten Sie: "))
if versuch < geheimnis:
print("zu klein")
if versuch > geheimnis:
@Der-Eddy
Der-Eddy / count.py
Created March 27, 2017 18:12
OBS Death Counter
import keyboard #https://github.com/boppreh/keyboard
import time
import sys
import os
counter = 0
prefixCounter = 'Death Count:'
file = os.path.join(sys.path[0], 'count.txt')
def addCounter():
@Der-Eddy
Der-Eddy / Post_Template.user.js
Last active September 14, 2016 18:16
Greasemonkey Userscript
// ==UserScript==
// @name Post Template
// @namespace Elitepvpers
// @include *//www.elitepvpers.com/forum/*
// @version 1.1
// @author Der-Eddy
// @grant none
// ==/UserScript==
(function($){
// '\n' steht für eine Leerzeile

Keybase proof

I hereby claim:

  • I am Der-Eddy on github.
  • I am dereddy (https://keybase.io/dereddy) on keybase.
  • I have a public key whose fingerprint is 42B9 1AAD 06D5 5A7D 6B37 57B1 8E05 0154 000D 4790

To claim this, I am signing this object:

@Der-Eddy
Der-Eddy / 1. Python Theorie & Tipps.md
Last active February 17, 2017 20:55
Python Theorie & Tipps

python logo

#Allgemeine Infos

Dieser Guide soll als zusätzliche Hilfe beim lernen von Python dienen, am besten machst du einen Python Kurs bei SoloLearn oder CodeCademy.

#Python 2 und Python 3

Python 3 ist inzwischen 8 Jahre alt und sollte eigentlich schon vor LANGER Zeit seinen Vorhänger Python 2 ablösen, Python 3 hatte jedoch große Änderungen die zwar oft vieles besser gemacht haben aber dafür die Portierung erschwert haben. Allgemein gilt, wenn man direkt mit Python 3 ein Projekt anfängt hat man am Ende weniger Probleme mit der Wartung.

Date.prototype.getWeekNumber = function(){
var d = new Date(+this);
d.setHours(0,0,0);
d.setDate(d.getDate()+4-(d.getDay()||7));
return Math.ceil((((d-new Date(d.getFullYear(),0,1))/8.64e7)+1)/7);
};
Array.prototype.mapProperty = function(property) {
return this.map(function (obj) {
return obj[property];
@Der-Eddy
Der-Eddy / backup.sh
Created November 22, 2015 14:31
Ubuntu Backup
#!/bin/bash
/home/eddy/scripts/sqldump.sh
day=`date +%b-%d-%y`
srcfolder="/var/nginx/"
destfile="/home/eddy/backup/nginx-backup-$day.tar.bz2"
tar cfvj $destfile $srcfolder
find /home/eddy/backup/nginx-backup-* -mtime +3 -exec rm {} \;