Skip to content

Instantly share code, notes, and snippets.

View zekroTJA's full-sized avatar
🚀
Fuck it, ship it!

Ringo Hoffmann zekroTJA

🚀
Fuck it, ship it!
View GitHub Profile
@zekroTJA
zekroTJA / getHaste.java
Last active June 16, 2017 12:22
Hastebin upload snippet
/**
* Method by StupPlayer (https://github.com/StupPlayer)
* @param data input as string
* @return hastebin paste URL / error message
*/
public static String hastePost(String data) {
CloseableHttpClient client = HttpClientBuilder.create().build();
HttpPost post = new HttpPost("https://hastebin.com/documents");
try {
#!/bin/sh
# IF THERE IS A NEWER PYTHON VERSION AVAILABLE, CHANGE VERSION HERE
RELEASE=3.6.2
sudo apt-get install libbz2-dev liblzma-dev libsqlite3-dev libncurses5-dev libgdbm-dev zlib1g-dev libreadline-dev libssl-dev tk-dev
mkdir ~/python3
cd ~/python3
wget https://www.python.org/ftp/python/$RELEASE/Python-$RELEASE.tar.xz
tar xvf Python-$RELEASE.tar.xz
@zekroTJA
zekroTJA / cmd_clear.py
Created August 2, 2017 12:57
PYTHON DISCORD BOT: #04 - Clear Command
import discord
import asyncio
async def ex(args, message, client, invoke):
try:
ammount = int(args[0]) + 1 if len(args) > 0 else 2
except:
await client.send_message(message.channel, embed=discord.Embed(color=discord.Color.red(), descrition="Please enter a valid value for message ammount!"))
@zekroTJA
zekroTJA / pibackup.md
Created August 3, 2017 10:45
A little CMDer script to backup your Raspberry Pi

This script requires the program CMDer. Then go to your CMDer installation path (where the CMDer.exe is located) and create there the batch script:

backup.bat

REM Enter here the local path where the script should copy the backup to
SET backuplocation = "E:\Dateien\Raspberry Pi Backup"

SET current=%cd%
SET folder=%time:~0,2%-%time:~3,2%-%time:~6,2%_%date%
@zekroTJA
zekroTJA / classSerializer.java
Created August 4, 2017 08:34
Little snippet to save and read java initialized classes directly into a file
import java.io*;
/**
* Created by zekro on 24.05.2017 / 09:46
* DiscordBot/commands.chat
* © zekro 2017
*/
public class Serializer implements Serializable {
@zekroTJA
zekroTJA / zekro-code-policy-eng.md
Last active January 16, 2018 10:03
zekro Devevopment Code Policy

RELOCATED AND OUTDATED


zekro Development Code Policy (English)

Policy v.1.2.2   -   Last edited: 31.12.2017


@zekroTJA
zekroTJA / 1 - firstthingsfirst.md
Last active February 1, 2018 21:57
Python Google Spreadsheet API - Tutorial

Console commands

Windows (CMDer):

λ pip install oauth2client gspread

Linux:

$ sudo pip install oauth2client gspread
@zekroTJA
zekroTJA / atom-config.md
Created August 29, 2017 18:53
This is a document how I've configured and extended my Atom Editor.

This is a document how I've configured and extended my Atom Editor.
Last updated: 08/29/2017


Theme:

UI Theme:     Atom Material
Syntax Theme:     One Dark

@zekroTJA
zekroTJA / discord-py-permission-system.md
Last active June 12, 2019 23:36
discord.py - Permission system

0 - /settings.json

First of all, you can define your roles, you want to set for each specific level, in a external JSON file to change the settings without editing the source code.

{
    "perms":
    {
        "lvl1": ["Supporter", "Rolle2"],
        "lvl2": ["Admin", "Moderator"],
@zekroTJA
zekroTJA / readme.md
Last active July 28, 2023 18:51
How to build an embed Builder in JDA

Required Imports

import net.dv8tion.jda.core.EmbedBuilder;
import java.awt.Color;

Build the EmbedBuilder