Skip to content

Instantly share code, notes, and snippets.

@eofs
eofs / main.js
Created May 6, 2015 15:29
JS Module Example
var map = require('mappings.js');
// Source object
var source = {};
var results = map.song(source)
from django.db import models
from jsonfield import JSONField
class ModelA(models.Model):
data = models.IntegerField()
extra = JSONField
@eofs
eofs / master
Last active April 10, 2019 14:02
Remove keys of disconnected Saltstack minions
# Enable "presence" events
# - http://docs.saltstack.com/en/latest/ref/configuration/master.html#presence-events
# - http://docs.saltstack.com/en/latest/topics/event/master_events.html#presence-events
presence_events: True
reactor:
# Note: This tag has a typo in it (version 2014.1.5), subject to change!
- 'salt/presense/change':
- /srv/reactor/presence.sls
@eofs
eofs / models.py
Created March 22, 2013 14:36
Use of DRF Proxy's RemoteModels
from django.db import models
from rest_framework_proxy.db.models import ProxyModel
class Snippet(ProxyModel):
name = models.CharField(max_length=25)
body = models.TextField(blank=True)
@staticmethod
@eofs
eofs / models.py
Created December 17, 2012 16:22
Test project
from django.db import models
class ClassB(models.Model):
name = models.CharField(max_length=255)
class ClassA(models.Model):
name = models.CharField(max_length=255)
childs = models.ManyToManyField(ClassB, blank=True, null=True)