Skip to content

Instantly share code, notes, and snippets.

View Emzi0767's full-sized avatar

Mateusz Brawański Emzi0767

View GitHub Profile
@Emzi0767
Emzi0767 / daemonize.ps1
Last active October 10, 2017 21:04
Your daemon script is bad; here, hold this.
# daemonize.ps1
#
# Daemonizes your Discord bot.
#
# Arguments:
# -Executable]
# Path to bot's executable.
#
# -Arguments
# Optional arguments for the bot.
@Emzi0767
Emzi0767 / backup_db.sh
Last active September 16, 2017 20:56
PostgreSQL backup script
#!/bin/bash
## README
#
# Automatic PostgreSQL backup script
# Version: v1.0.5
# Author: Emzi0767
# Usage:
# ./backup_db.sh <database> <username> <password> <max_count>
#
@Emzi0767
Emzi0767 / avset.py
Last active May 17, 2017 20:40
Overly fancy avatar update script, based on d.py
import asyncio
import discord
import argparse
class AvatarClient(discord.Client):
def __init__(self, token: str, filename: str, username: str):
super().__init__()
self._av_token = token
self._av_filename = filename
@Emzi0767
Emzi0767 / NativeGlue.cs
Last active April 5, 2017 11:23
Unmanaged glue for Discord.NET
using System;
using System.Runtime.InteropServices;
using Discord;
using Discord.WebSocket;
namespace Emzi0767.GluedEval
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void SendMessageDelegate(ulong channel, string msg, IntPtr embed);