Skip to content

Instantly share code, notes, and snippets.

View akkefa's full-sized avatar
💻
Grit

Ikram Ali akkefa

💻
Grit
View GitHub Profile
@akkefa
akkefa / VolleySingleton.java
Created December 25, 2015 17:49
Google Volley starter Kit
package com.example.ikram.bathak.network;
import android.graphics.Bitmap;
import android.support.v4.util.LruCache;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;
import com.example.ikram.bathak.MyApplication;
//
// RoundedCornersView.swift
// Akkefa
//
// Created by Ikram ali
//
import UIKit
@IBDesignable
## Managing date at django database
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
from django.core import serializers
from django.http import JsonResponse, HttpResponse
def home_page(request):
rooms = Room.objects.all().prefetch_related(Prefetch('images', queryset=Image.objects.order_by('-created_at')))
return HttpResponse(serializers.serialize('json', rooms), content_type='application/json')
@akkefa
akkefa / gist:8b974ac297f6fa61538179971bced0c8
Created April 12, 2017 02:42 — forked from evildmp/gist:3094281
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

Using familiar syntax, you can view the contents of your S3 buckets in a directory-based listing.
$ aws s3 ls s3://mybucket
LastWriteTime Length Name
------------- ------ ----
PRE myfolder/
2013-09-03 10:00:00 1234 myfile.txt
...
You can perform recursive uploads and downloads of multiple files in a single folder-level command. The AWS CLI will run these transfers in parallel for increased performance.
from skimage import io
from skimage.color import rgb2gray
from skimage.transform import resize, rotate
arr = resize(io.imread('black.jpg'),(32,32))
arr = rgb2gray(arr)
# To support both python 2 and python 3
from __future__ import division, print_function, unicode_literals
# To support both python 2 and python 3
from __future__ import division, print_function, unicode_literals