Skip to content

Instantly share code, notes, and snippets.

View saifat29's full-sized avatar

Saif Ali Khan saifat29

  • Mumbai, India
View GitHub Profile
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
function downloadObjectAsJson(exportObj, exportName){
var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(exportObj));
var downloadAnchorNode = document.createElement('a');
downloadAnchorNode.setAttribute("href", dataStr);
downloadAnchorNode.setAttribute("download", exportName + ".json");
document.body.appendChild(downloadAnchorNode);
downloadAnchorNode.click();
downloadAnchorNode.remove();
}
from itertools import product
checker = [
"2", "1", "2", "1", "2", "1", "2", "1",
"2", "1", "2", "1", "2", "1", "2", "1"
]
def sum_card_digits(card_num):
@saifat29
saifat29 / gist:56ce067318f4e783cb60cc05ca7a96ec
Last active November 1, 2019 13:58 — forked from luckydev/gist:b2a6ebe793aeacf50ff15331fb3b519d
Increase max no of open files limit in Ubuntu 16.04/18.04 for Nginx
# maximum capability of system
user@ubuntu:~$ cat /proc/sys/fs/file-max
708444
# available limit
user@ubuntu:~$ ulimit -n
1024
# To increase the available limit to say 200000
user@ubuntu:~$ sudo vim /etc/sysctl.conf

Django Steps

Terminologies


The architectural design pattern of django is MVT (Model-View-Template)

Django Project: It is a collection of applications and configurations that when combined together will make up the full web application.

Django Application: It is created to perform a particular functionality for the entire web application. It can work individually and can be plugged into a project due to its modularity. e.g. registration app, comments app, etc. These Django Apps can then be plugged into other Django Projects, so you can reuse them.

# GROOT
# I made this cowsay character based on an image whose cowsay
# file I couldn't find.
# This is just an exact replica of the original.
# Let me know the original author on devRant
# I go by the username 'spoonsearch'
#
$the_cow = <<EOC;
# Author: spoonsearch
# Feel free to share and modify, and tag me in the modified version on devRant.
# Happy Ranting
$the_cow = <<EOC;
$thoughts
$thoughts
`..--:::::::::::--..` .
`.- :-.`
.- -.