Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block saschalalala

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import UserManager
class User(AbstractBaseUser, PermissionsMixin):
User model, extends `django.contrib.auth.models.AbstractBaseUser`
saschalalala /
Created Jun 3, 2017
telegram_bot decorators
def admin_only(func):
def check_permissions(*args, **kwargs):
bot = args[0]
update = args[1]
admin_ids = list(Player.objects.filter(gm=True).values_list('telegram_id', flat=True))
current_user = update.message.from_user
if not in admin_ids:
update.message.reply_text("You are not allowed to do this, Troubleshooter. This incident will be reported")
message = "The user {} just entered a forbidden command.".format(current_user)
log_channel_id = Game.objects.get(pk=1).channel_id
View cookieconsent.js
var cookieconsent_wrapper = function() {
console.log("I am running");
// Stop from running again, if accidently included more than once.
if (window.hasCookieConsent) return;
window.hasCookieConsent = true;
saschalalala / _dnf
Created Jun 8, 2015
zsh completion file for dnf
View _dnf
#compdef dnf
# Main dispatcher
local curcontext="$curcontext" state lstate line
_arguments -s \
'(- *)'{-h,--help}'[show the help message]' \
'(-t --tolerant)'{-t,--tolerant}'[be tolerant of errors]' \
You can’t perform that action at this time.