This file contains hidden or 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
$.widget("ui.combobox", { | |
_create: function() { | |
var input, | |
self = this, | |
select = this.element.hide(), | |
selected = select.find(":selected"), | |
value = selected.val() ? selected.text() : "", | |
wrapper = this.wrapper = $("<span>").addClass("ui-combobox").insertAfter(select); | |
input = $("<input>") | |
.appendTo(wrapper) |
This file contains hidden or 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
#!/usr/bin/env php | |
<?php | |
$server = "localhost"; | |
$username = "***"; | |
$password = "****"; | |
$connection = mysql_connect($server, $username, $password); | |
if (!$connection) { | |
die("Connection error: " . mysql_error()); |
This file contains hidden or 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
{% if not debug %} | |
<script> | |
var _gaq = window._gaq || []; | |
window.onerror = function(msg, url, line) { | |
var preventErrorAlert = true; | |
_gaq.push(['_trackEvent', 'JS Error', msg, '#{{ employee.id|default:"0" }} ip:{{ request.META.REMOTE_ADDR|escapejs }} ua:{{ request.META.HTTP_USER_AGENT|escapejs }} url:' + url + " line:" + line, 0, true]); | |
return preventErrorAlert; | |
}; | |
jQuery.error = function (message) { | |
_gaq.push(['_trackEvent', 'jQuery Error', message, '#{{ employee.id|default:"0" }} ip:{{ request.META.REMOTE_ADDR|escapejs }} ua:{{ request.META.HTTP_USER_AGENT|escapejs }}', 0, true]); |
This file contains hidden or 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
/* | |
* Copyright (c) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '2', |
This file contains hidden or 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
{% macro form_open(form, action="", method="post", class="") -%} | |
<form role="form"{% if class %} class="{{ class }}"{% endif %}{% if action %} action="{{ action }}"{% endif %} method="{{ method|default("post") }}" {% if form.is_multipart() %}enctype="multipart/form-data" {% endif %}> | |
{%- for field in form.hidden_fields() -%} | |
{{ field|safe }} | |
{%- endfor -%} | |
{% endmacro %} | |
{% macro form_open_horizontal(form, action="", method="post") -%} | |
{{ form_open(form, action=action, method=method, class="form-horizontal") }} |
This file contains hidden or 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
# _*_ coding: utf-8 _*_ | |
# http://xn--80aiqe1a.xn--p1ai/kladr.html | |
from django.db import models | |
class KladrManager(models.Manager): | |
def filter_state(self, code=None, actual=True, queryset=None): | |
if queryset is None: | |
queryset = self.get_query_set() | |
queryset = queryset.extra(where=["code LIKE %s"], params=["%000000000__"]) |
This file contains hidden or 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 os | |
from django.conf import settings | |
from pipeline.compilers import SubProcessCompiler | |
class LessCompiler(SubProcessCompiler): | |
output_extension = "css" | |
def match_file(self, filename): | |
return filename.endswith(".less") |
This file contains hidden or 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
/** | |
* Plugin: "optgroup_checkbox" (selectize.js) | |
* Copyright (c) 2015 Dmitri Piatkov & contributors | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this | |
* file except in compliance with the License. You may obtain a copy of the License at: | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software distributed under | |
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF |
This file contains hidden or 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
jQuery(function($){ | |
$(document).on("copy", function () { | |
var selection, html = ""; | |
if (window.getSelection || document.getSelection) { | |
selection = window.getSelection ? window.getSelection() : document.getSelection(); | |
if (selection.rangeCount) { | |
html = document.createElement("div"); | |
for (var i = 0, n = selection.rangeCount; i < n; ++i) { | |
html.appendChild(selection.getRangeAt(i).cloneContents()); |
This file contains hidden or 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
<div class="input-group"> | |
<input class="form-control" id="id_password" name="password" required="required" type="password" value="" /> | |
<label class="input-group-addon" for="id_password" id="id_password_toggle"> | |
<i class="fa fa-eye-slash"></i> | |
</label> | |
</div> | |
<script> | |
jQuery(function($) { | |
var input = $("#id_password"); | |
$("#id_password_toggle").on("mousedown", function() { |
OlderNewer