Skip to content

Instantly share code, notes, and snippets.

View satran's full-sized avatar

Satyajit Ranjeev satran

View GitHub Profile
@satran
satran / json_exception.py
Created July 16, 2012 07:22
JSON exception Middleware
from django.http import HttpResponseServerError
import json
import traceback
import sys
class JSONException(object):
'''
Return all exceptions as a JSON object.
'''
@satran
satran / github-issues.py
Created April 29, 2013 05:33
The small program used for the talk at Pune Python User Group meetup on April 2013. Please feel free to update this script and make a pull request.
# Packages and modules are imported to the scope using the import statement.
# If you wanted just a particular object from a module/package you can use
# the from <module> import <object>
import sys
import requests
# There are no constants in Python, still we can use a naming convention to
# imply that to the user of a library.
BASE_URL = "https://api.github.com"
;; Taken from https://andreyor.st/posts/2020-05-10-making-emacs-tabs-look-like-in-atom/
;; https://github.com/andreyorst/dotfiles/blob/740d346088ce5a51804724659a895d13ed574f81/.config/emacs/README.org#tabline
(defun my/set-tab-theme ()
(let ((bg (face-attribute 'mode-line :background))
(fg (face-attribute 'default :foreground))
(hg (face-attribute 'default :background))
(base (face-attribute 'mode-line :background))
(box-width (/ (line-pixel-height) 4)))
(set-face-attribute 'tab-line nil