Skip to content

Instantly share code, notes, and snippets.

View naushad-rahman's full-sized avatar

Naushad Rahman naushad-rahman

View GitHub Profile
@naushad-rahman
naushad-rahman / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created April 12, 2019 02:58 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@naushad-rahman
naushad-rahman / Makefile
Created September 25, 2018 14:12 — forked from mbeltagy/Makefile
For the Julia calling C minimal example
CC=gcc
CFLAGS=-c -Wall -fPIC
SOURCES=calc_mean.c
OBJECTS=$(SOURCES:.c=.o)
.c.o:
$(CC) $(CFLAGS) $< -o $@
@naushad-rahman
naushad-rahman / using_requests_with_django.py
Created January 19, 2018 09:42 — forked from hbradio/using_requests_with_django.py
An example of using Python requests to log in and post data to your Django API
import requests
LOGIN_URL = "http://mydjangosite.com/accounts/login/"
ENDPOINT_URL = 'http://mydjangosite.com/myendpoint/'
'''
Create a session.
A session will automatically store the cookies that Django
sends back to you, like the csrf token and a the session id. You
could do it without the session, but then you'd have to save off the
@naushad-rahman
naushad-rahman / download-data.py
Created May 7, 2016 16:03 — forked from ramhiser/download-data.py
Downloads Kaggle Data - Handwriting Recognition
import requests
# The direct link to the Kaggle data set
data_url = 'http://www.kaggle.com/c/digit-recognizer/download/train.csv'
# The local path where the data set is saved.
local_filename = "train.csv"
# Kaggle Username and Password
kaggle_info = {'UserName': "my_username", 'Password': "my_password"}