If we detect angular is present, we can expose a directive:
<ANY moment date="scope.myDate" format="'lll'"></ANY>
'use strict';
/**
#!/bin/bash | |
# fix display for Sceptre 40" X405BV-FHD3 on Fedora 20. | |
# this is done by turning on the underscan feature with xrandr. | |
# usage: call this script from within /etc/gdm/Init/Default. | |
xrandr --output HDMI-1 \ | |
--set "underscan" on \ | |
--set "underscan hborder" 50 \ | |
--set "underscan vborder" 30 |
/* | |
* grab: move a process from one tty to another. | |
* Version 0.0.1 | |
* | |
* Written by Bernard Blackham. This code is in the public domain. | |
* | |
* This is a very quick hack and quite a mess. Needs a lot of polish. It is | |
* also nowhere near perfect. | |
* | |
* Usage: |
@context = { 'myhash' => { 'b' => 'B', 'a' => 'A', 'c' => 'C' } } | |
@template = Liquid::Template.parse("{{ myhash | keys | to_ul }}") | |
@template.render(@context) # => "<ul><li>b</li><li>a</li><li>c</li></ul>" | |
@template = Liquid::Template.parse("{{ myhash | keys | sort | to_ul }}") | |
@template.render(@context) # => "<ul><li>a</li><li>b</li><li>c</li></ul>" |
language: python | |
python: | |
- "2.7" | |
install: | |
- pip install tox | |
script: | |
- tox |
[tox] | |
envlist = py{26,27,33} | |
[testenv] | |
commands = python setup.py test |
-- mirror the bugzilla milestones in another picklist | |
-- developers have their own target milestones (the default picklist for milestones) | |
-- support engineers have their own support milestones which is a custom field. | |
-- milestones -> cf_support_milestone | |
delimiter // | |
CREATE TRIGGER cf_milestones_insert | |
AFTER INSERT ON milestones | |
FOR EACH ROW |
# code snippet from django.utils.autoreload (BSD license) | |
# https://github.com/django/django/blob/master/django/utils/autoreload.py | |
def code_changed(): | |
global _mtimes, _win | |
for filename in gen_filenames(): | |
stat = os.stat(filename) | |
mtime = stat.st_mtime | |
if _win: | |
mtime -= stat.st_ctime |
If we detect angular is present, we can expose a directive:
<ANY moment date="scope.myDate" format="'lll'"></ANY>
'use strict';
/**
# License: MIT | |
# django-rest-framework mixin | |
class CachedReprMixin(serializers.ModelSerializer): | |
''' | |
mixin for ModelSerializer subclass whose model has a 'modified' field. | |
assuming the model has a 'modified' field: | |
modified = models.DateTimeField(auto_now=True) |
class CustomDatabaseCreation(BaseDatabaseCreation): | |
def sql_create_model(self, model, style, known_models=set()): | |
final_output, pending_references = super(CustomDatabaseCreation, self).sql_create_model(model, style, known_models) | |
# get output generated by parent class for unique_together. | |
for field_constraints in opts.unique_together: | |
line = (' ' + style.SQL_KEYWORD('UNIQUE') + ' (%s)' % | |
", ".join( | |
[style.SQL_FIELD(qn(opts.get_field(f).column)) | |
for f in field_constraints])) |