Skip to content

Instantly share code, notes, and snippets.

@settipalli
settipalli / pom.xml
Created February 8, 2019 11:40
Maven starter template.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.epi</groupId>
<artifactId>EPI</artifactId>
<version>1.0-SNAPSHOT</version>
@settipalli
settipalli / git-log-fix.sh
Last active February 13, 2019 23:02
Fix git log
#!/usr/bin/env bash
git config --global --replace-all core.pager 'less -F -X -R -K'
# Set editor to VIM inplace of Nano
git config --global core.editor "vim"
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const int INF = 99*999 + 1;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
@settipalli
settipalli / books.csv
Created June 19, 2018 01:34
A sample list of book details downloaded by the py_gr_book_list project.
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 7 columns, instead of 4. in line 7.
The Story of Art (Hardcover),E.H. Gombrich,3.88,371409,1950,art,www.goodreads.com//book/show/222078.The_Story_of_Art
The New Drawing on the Right Side of the Brain (Paperback),Betty Edwards,3.84,397471,1979,art,www.goodreads.com//book/show/627206.The_New_Drawing_on_the_Right_Side_of_the_Brain
Wall and Piece (Paperback),Banksy,3.84,302128,1988,art,www.goodreads.com//book/show/114683.Wall_and_Piece
Steal Like an Artist: 10 Things Nobody Told You About Being Creative (Paperback),Austin Kleon,3.88,278559,2012,art,www.goodreads.com//book/show/13099738-steal-like-an-artist
Girl with a Pearl Earring (Paperback),Tracy Chevalier,3.86,717160,1999,art,www.goodreads.com//book/show/2865.Girl_with_a_Pearl_Earring
The Artist's Way (Paperback),Julia Cameron,3.89,154488,1992,art,www.goodreads.com//book/show/615570.The_Artist_s_Way
The Art Book (Paperback),Phaidon Press,3.81,227646,1997,art,www.goodreads.com//book/show/567616.The_Art_Book
Art and Fear: Observations on the Perils (and Rewards) of Artmaking,David Bayles,3.7,1398
@settipalli
settipalli / gist:6aaa12eefb4fa3aee2f0
Created September 13, 2015 07:01
Mathematics-Books
All the Mathematics You Missed: But Need to Know for Graduate School
Mathematics: Its Content, Methods and Meaning
Mathematics for the Million: How to Master the Magic of Numbers
Nicolas Bourbaki
The Artist and the Mathematician: The Story of Nicolas Bourbaki, the Genius Mathematician Who Never Existed
https://sites.google.com/site/math104sp2011/lecture-notes
http://math.stackexchange.com/questions/69060/what-is-a-good-book-for-learning-math-from-the-ground-up
http://math.stackexchange.com/questions/178302/i-want-to-start-mathematics-from-scratch-what-should-i-begin-with
@settipalli
settipalli / django-urls.py-format
Created November 5, 2012 14:15
Django urls.py format.
# django urls.py format
(regular expression, Python callback function [, optional dictionary])
@settipalli
settipalli / apache2-configuration-file-for-django-wsgi-project.
Created November 5, 2012 12:17
Apache2 configuration file for Django-wsgi-project.
# Apache 2 - wsgi configuration.
<VirtualHost *:80>
WSGIScriptAlias / <absolute-path-to-.wsgi-file>
ServerName <some-server-alias>
Alias /static <absolute-path-to-the-django-project-static-files-folder>
<Directory <absolute-path-of-the-django-project-directory> >
Order allow,deny
Allow from all
</Directory>
@settipalli
settipalli / Django-virtualenv-wsgi-sample-configuration
Created November 5, 2012 12:14
Django-virtualenv-wsgi-sample-configuration
# contents of a django wsgi file.
import os
import sys
SITE_PACKAGES_DIR='<absolute-path-to-virtualenv-folder>/lib/python2.7/site-packages'
DJANGO_PROJECT_PARENT_FOLDER='<absolute-path-to-django-project-folder>'
DJANGO_PROJECT_PATH='<absolute-path-to-django-project-app-folder>'
SETTINGS_FILE='settings'
# Add the virtual Python environment site-packages directory to the path
@settipalli
settipalli / django-logging-configuration
Created November 5, 2012 12:08
Django-Sample-Logging-Configuration
# django settings.py - LOGGING configuration
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
@settipalli
settipalli / gist:2717426
Created May 17, 2012 08:37
Save a file with root permissions from within VIM
This trick will help when you open a file using normal user and then realize that you need to be root to save the file:
In command mode:
:w !sudo tee %
Ref: http://stackoverflow.com/questions/1005/getting-root-permissions-on-a-file-inside-of-vi