This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vignesh Krishnan, [16.10.15 19:17] | |
Oh, I've always wanted to ask you guys. How do you look at free and open source gaming? The concept doesn't appeal well to me IMO | |
Venkatesh T Vinaitheerthan, [16.10.15 19:18] | |
[In reply to Vignesh Krishnan] | |
What's IMO..I've played some games..weren't as good as CS | |
Vignesh Krishnan, [16.10.15 19:20] | |
No no.. What I am saying is, how can the concept of Free and open source software be applied to developing games? I get the knowledge sharing thing, but releasing your assets would easily give way to people ripping off what you've done right? @hacktivist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sample Code Used in repo here : https://github.com/ramaseshan/salt-stack-examples | |
The Plan | |
1. Basic Introduction to Salt - 10 min (Installation and basic usage) | |
2. Introduction to software installation using salt -10 min (How to install or update a software) | |
3. How to create and manage an infrastructure with saltstack - 20 min (Installing multiple packages, various ways of installation) | |
-> We will be installing a few packages like python-pip, python-virtualenv, | |
-> Create a virtualenv and install django inside it | |
-> Create a default django project and start the dev server | |
-> Well you really need to edit the code ?? So lets go god mode (vim + tmux + the good old terminal) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.files.storage import FileSystemStorage | |
fs = FileSystemStorage(location=settings.MEDIA_ROOT) | |
def upload_media_handler(instance, filename): | |
import unicodedata | |
filename = unicodedata.normalize('NFKD', filename).encode('ascii','ignore') | |
filename = filename.translate(None,"!,;()[]'") | |
return "{id}/media/{file}".format(id=instance.reference_number, file=(filename.replace(" ","_"))) | |
class Media(Models): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Do only a request.POST | |
@login_required | |
def advanced(request): | |
return_dict = {} | |
if request.method == "POST": | |
name = request.POST.get("name") | |
desc = request.POST.get("desc") | |
results = Media.objects.filter(*(args,)).distinct() | |
paginator = Paginator(results, 25) # Show 25 contacts per page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sublists(symps): | |
# sample input [1,2,3] Ex Output [[1],[2],[3],[1,2],[2,3],[1,3],[1,2,3]] | |
length = len(symps) | |
i = 0 | |
poss = [] | |
while i < length: | |
temp = [] | |
size = length - i | |
temp = [sublist for sublist in (symps[x:x+size] for x in range(len(symps) - size + 1))] | |
i = i +1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Symptoms(models.Model): | |
symid = models.AutoField(primary_key=True) | |
sym_name = models.CharField(max_length=100,blank=False,null=False) | |
def __unicode__(self): | |
return self.sym_name | |
class Disease(models.Model): | |
did = models.AutoField(primary_key=True) | |
d_name = models.CharField(max_length=100,blank=False,null=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# STATIC FILE CONFIGURATION | |
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root | |
STATIC_ROOT = join(os.path.dirname(BASE_DIR), 'staticfiles') | |
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url | |
STATIC_URL = '/static/' | |
# See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS | |
STATICFILES_DIRS = ( | |
join(BASE_DIR, 'static'), |