Skip to content

Instantly share code, notes, and snippets.

View dimitrov's full-sized avatar

Dimitar Dimitrov dimitrov

View GitHub Profile
{
"TxnID": "667B-1055542407",
"TimeCreated": "2003-06-13T15:13:27-08:00",
"TimeModified": "2019-12-14T11:35:28-08:00",
"EditSequence": "1576351936",
"TxnNumber": "1276",
"CustomerRef": {
"ListID": "6D0000-1046201334",
"FullName": "Pete Harbin Contractor:Oak Street"
},
<nav>
<ul class="pagination pull-right">
<li {% if not page_obj.has_previous %}class="disabled"{% endif %}>
{% if page_obj.has_previous %}
<a href="?page={{ page_obj.previous_page_number }}" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
{% else %}
<a href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>
{% endif %}
@dimitrov
dimitrov / messages.html
Created April 26, 2015 20:30
Bootstrap Alerts for Django
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }} alert-dismissible text-center" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<strong>{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}Error{% else %}{{ message.tags|title }}{% endif %}!</strong> {{ message }}
</div>
{% endfor %}
{% endif %}
@dimitrov
dimitrov / Gruntfile.js
Last active August 29, 2015 14:17
grunt-sass + grunt-contrib-watch
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
options: {
sourceMap: true
},
dist: {
files: {
'styles/css/widgets.css': 'styles/sass/widgets.scss'
@dimitrov
dimitrov / Mapping Script
Created March 9, 2015 14:05
Jenkins Warnings Plugin mapping script for flake8
import hudson.plugins.warnings.parser.Warning
import hudson.plugins.analysis.util.model.Priority
String fileName = matcher.group(1)
String type = matcher.group(4)
String lineNumber = matcher.group(2)
String message = matcher.group(5)
String typeCategory = String.valueOf(type.charAt(0));
String category
Priority priority = Priority.NORMAL
#!/usr/bin/env bash
pip install -r requirements-dev.txt
python manage.py migrate
coverage run manage.py test
coverage xml
flake8 --ignore=E121,E123,E124,E125,E126,E127,E128,E501,E402 --exit-zero <package>
Django - 1.5.4 - active
Fabric - 1.5.3 - active
GeoIP - 1.2.9 - active
Hoover - 0.6.0 - active
Pillow - 2.0.0 - active
Python - 2.7.3 - active development (/usr/lib/python2.7/lib-dynload)
South - 0.8 - active
Unidecode - 0.04.14 - active
amqp - 1.0.11 - active
anyjson - 0.3.3 - active
Django 1.6.5 has no metadata
Fabric - 1.5.3 - active
PIL - 1.1.7 - active
Pillow - 2.0.0 - active
PyYAML - 3.11 - active
Python - 2.7.6 - active development (/usr/lib/python2.7/lib-dynload)
South - 0.7.6 - active
Unidecode - 0.04.14 - active
argh - 0.24.1 - active
argparse - 1.2.1 - active development (/usr/lib/python2.7)
@dimitrov
dimitrov / watch.py
Last active August 29, 2015 14:06
watch.py
#!/usr/bin/env python
import os
import time
import logging
import subprocess
from watchdog.observers import Observer
from watchdog.events import (
PatternMatchingEventHandler, EVENT_TYPE_MODIFIED, EVENT_TYPE_MOVED,
@dimitrov
dimitrov / Preferences.sublime-settings
Last active August 29, 2015 14:03
Preferences.sublime-settings
{
"auto_complete_triggers":
[
{
"characters": ".",
"selector": "source.python"
}
],
"close_windows_when_empty": false,
"color_scheme": "Packages/User/Tomorrow-Night (SL).tmTheme",