Skip to content

Instantly share code, notes, and snippets.

AK Adapa akaak

Block or report user

Report or block akaak

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
@robgolding
robgolding / login_required.py
Created Jul 11, 2012
Django Class-Based View Mixins: Part 1
View login_required.py
class LoginRequiredMixin(object):
"""
View mixin which requires that the user is authenticated.
"""
@method_decorator(login_required)
def dispatch(self, request, *args, **kwargs):
return super(LoginRequiredMixin, self).dispatch(
self, request, *args, **kwargs)
@akaak
akaak / unrar.sh
Created Oct 29, 2015
Go through far files in a directory and unrar them.
View unrar.sh
# Go through all files with extension .rar.
# create a folder with DIR_FileName
# Unrar each rar file and keep them in the respective directory
# install unrar using "brew" on mac
#
for filename in *.rar;
do echo "put ${filename}";
mkdir RAR_${filename}
unrar ${filename} RAR_${filename}
done
You can’t perform that action at this time.