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 / 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"}