Skip to content

Instantly share code, notes, and snippets.

View sid24ss's full-sized avatar

Sidd Swaminathan sid24ss

View GitHub Profile
caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= @%H - %LD %d %LM - %c"
defscrollback 1000000
startup_message off
@sid24ss
sid24ss / github-issues-export.py
Created June 3, 2015 06:32
Exports *all* issues from a github repository into a `pickle` file
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import csv
import requests
import cPickle as pickle
@sid24ss
sid24ss / django_proxy.md
Last active August 29, 2015 14:20
Deploying Django with mod_wsgi on a server behind proxy

Follow the steps for deploying Django with Apache and mod_wsgi.

This means that the WSGIDaemon runs under the user www-data, which is a special linux user for Apache.

If you have to connect to the internet, you need to set the $http_proxy and $https_proxy variables. Set them in your /etc/environment file.

This still doesn't mean that the environment variables are set for the www-data user. You need to set the same in the /etc/apache2/envvars file, which sets the environment variables for the www-data user.

@sid24ss
sid24ss / gist:5d01f7f4661c49514111
Created November 16, 2014 07:03
triple pointers
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World" << endl;
int*** a;
a = new int**[10];
for (int i = 0; i < 10; i++) {
@sid24ss
sid24ss / Bresenham line
Created September 21, 2014 20:12
Bresenham line points
inline std::vector< std::pair<int,int> > getBresenhamLinePoints(int x1, int y1, int x2, int y2)
{
std::vector <std::pair<int, int> > out_points;
bool steep = (std::abs(y2 - y1) > std::abs(x2 - x1));
if(steep){
std::swap(x1, y1);
std::swap(x2, y2);
}
if(x1 > x2){