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
""" | |
to set up auth token first authorize jenkins as an slack app and install | |
https://wiki.jenkins.io/display/JENKINS/Slack+Plugin | |
Afterwards, use https://plugins.jenkins.io/credentials-binding, which is most likely available in your jenkins install | |
and use the instructions from there to share credentials with job. Accessing credentials in python requires: os.environ['xxx'] | |
""" | |
import os | |
import requests | |
import json |
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
# update your app settings.py with RedisSubscriber: | |
WS4REDIS_SUBSCRIBER = 'your_app.your_module.subscriber.RedisSubscriber' |
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
javascript:!function(a){var b=document.createElement("textarea"),c=document.getSelection();b.textContent=a,document.body.appendChild(b),c.removeAllRanges(),b.select(),document.execCommand("copy"),c.removeAllRanges(),document.body.removeChild(b)}(document.title.split("]")[0].replace("[","")+" - "+document.getElementById("summary-val").textContent); |
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
import re | |
from django.core.validators import EMPTY_VALUES | |
from django.utils.encoding import smart_text | |
from rest_framework.fields import CharField | |
from localflavor.us.forms import USPhoneNumberField as FormUSPhoneNumberField, phone_digits_re | |
from django.core.exceptions import ValidationError | |
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 rest_framework.fields import RegexField | |
from localflavor.us.forms import USZipCodeField as FormUSZipCodeField | |
class USZipCodeField(RegexField): | |
"""" | |
A form field that validates input as a U.S. ZIP code. Valid formats are | |
XXXXX or XXXXX-XXXX. | |
.. note:: | |
If you are looking for a form field with a list of U.S. Postal Service | |
locations please use :class:`~localflavor.us.forms.USPSSelect`. |
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
[MASTER] | |
# Specify a configuration file. | |
#rcfile= | |
# Python code to execute, usually for sys.path manipulation such as | |
# pygtk.require(). | |
#init-hook= | |
# Profiled execution. |
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
/* jslint browser: true, undef: true, newcap: true, forin: true, sub: true, white: true, indent: 4, unused: false */ | |
/* globals define: true, Settings: true, console: true */ | |
define([ | |
'app/app', | |
'ngCordova', | |
], function( | |
App | |
) { | |
"use strict"; |
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
<li class="form-field" ng-class="{invalid: errors[name], error: errors[name]}"> | |
<input ng-model="model" ng-init="model" type="{[{field.type}]}" ng-required="{[{field.required}]}" placeholder="{[{field.label}]}" ng-maxlength="{[{field.max_length}]}" name="{[{name}]}"/> | |
<ng-include ng-if="errors[name]" src="'templates/directives/aa-forms/error_list.html'"></ng-include> | |
</li> |
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 datetime import datetime | |
from dateutil.relativedelta import relativedelta | |
from django.template import Library | |
from django.template import Node, TemplateSyntaxError | |
from django.utils.timezone import get_current_timezone | |
from django.template.defaultfilters import date | |
from django.conf import settings | |
register = Library() |
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
elm.bind('paste', function(e) { | |
//console.log(e); | |
e.preventDefault(); | |
var text = (e.originalEvent || e).clipboardData.getData("text/html"); | |
if (!text){ | |
console.log('no html'); | |
text = (e.originalEvent || e).clipboardData.getData("text/plain"); | |
} | |
var temp = $('<div />'); | |
$(temp).html(text); |