Skip to content

Instantly share code, notes, and snippets.

View dhirajt's full-sized avatar
🎯
Focusing

Dhiraj Thakur dhirajt

🎯
Focusing
  • Faridabad, India
View GitHub Profile
# -*- coding: utf-8 -*-
from django.core.mail import send_mail, mail_managers, EmailMultiAlternatives
from django.template.loader import render_to_string
from django.conf import settings
class Mailing:
path_prefix = 'mail/'
path_suffix = '.html'
prefix_title = u"TITLE BEGINNING - "
@dhirajt
dhirajt / mixin.py
Created December 29, 2013 08:52 — forked from cyberdelia/mixin.py
# -*- coding: utf-8 -*-
from django.contrib.auth.decorators import login_required
from django.utils.cache import patch_response_headers
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page, never_cache
from django.views.decorators.csrf import csrf_exempt
class NeverCacheMixin(object):
@method_decorator(never_cache)

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@dhirajt
dhirajt / index.html
Created November 8, 2013 07:47 — forked from crofty/index.html
<!DOCTYPE html>
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script>
</head>
<body>
# download and make Redis
$ wget http://redis.googlecode.com/files/redis-2.6.7.tar.gz
$ sudo tar xzf redis-2.6.7.tar.gz -C /usr/lib/
$ cd /usr/lib/redis-2.6.7
$ sudo make
# create symlinks to the /usr/local/bin
$ sudo ln -s /usr/lib/redis-2.6.7/src/redis-server /usr/local/bin/redis-server
$ sudo ln -s /usr/lib/redis-2.6.7/src/redis-cli /usr/local/bin/redis-cli