Reproducing an existing model setup
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
#include <SPI.h> | |
#include "SdFat.h" | |
#include <LiquidCrystal.h> | |
const byte pinClock = 3; // AY38910 clock | |
const byte pinReset = 2; // AY38910 reset | |
const byte pinBC1 = 8; // AY38910 BC1 | |
const byte pinBDIR = 9; // AY38910 BDIR | |
const byte pinSHCP = 4; // 74HC595 clock | |
const byte pinSTCP = 5; // 74HC595 latch |
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
$.validator.addMethod("inn", function (value, element) { | |
var multipliers = [3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8], | |
inn = value.split(''), i, j, ch = [0, 0, 0]; | |
for (i = 0; i < 12; i++) | |
for (j = 0; j < 3; j++) | |
if (multipliers[i + j]) | |
ch[j] = ch[j] + inn[i] * multipliers[i + j]; | |
if (inn.length == 10) | |
return inn[9] == ch[2] % 11 % 10; | |
else if (inn.length == 12) |
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
(function() { | |
/* Define a variável que dá swipe no lightbox */ | |
var magnificPopup = $.magnificPopup.instance; | |
/* Carrega a função quando clica no lightbox (senão não pega a classe utilizada) */ | |
$("a.image-lightbox").click(function(e) { | |
/* Espera carregar o lightbox */ | |
setTimeout(function() { | |
/* Swipe para a esquerda - Próximo */ |
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
[uwsgi] | |
socket = /tmp/example.com.sock | |
; Worker processes | |
master = 1 | |
processes = 4 | |
; Virtualenv and home directory | |
virtualenv = /var/virtualenvs/example.com | |
chdir = /var/www/example.com |
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
"""Add user created_by and modified_by foreign key refs to any model automatically. | |
Almost entirely taken from https://github.com/Atomidata/django-audit-log/blob/master/audit_log/middleware.py""" | |
from django.db.models import signals | |
from django.utils.functional import curry | |
class WhodidMiddleware(object): | |
def process_request(self, request): | |
if not request.method in ('GET', 'HEAD', 'OPTIONS', 'TRACE'): | |
if hasattr(request, 'user') and request.user.is_authenticated(): | |
user = request.user |