Run this command to remember your password:
git config --global credential.helper 'cache --timeout 28800'
Above command will tell git to cache your password for 8 hours.
*.pyc | |
conf.py |
(r'^articles/(?P<year>\d{4}/?$, 'main.views.year'), | |
# When a use case comes up that a month needs to be involved as | |
# well, you add an argument in your regex: | |
(r'^articles/(?P<year>\d{4}/(?P<month>\d{2})/?$, 'main.views.year_month'), | |
# That works fine, unless of course you want to show something | |
# different for just the year, in which case the following case can be | |
# used, making separate views based on the arguments as djangoproject |
server { | |
listen 80; | |
server_name nagios.example.tld; | |
access_log /var/log/nginx/nagios.access.log; | |
error_log /var/log/nginx/nagios.error.log info; | |
expires 31d; | |
root /usr/share/nagios3/htdocs; |
from django.template import Variable, defaultfilters | |
from django.http import HttpResponse | |
import xlwt | |
def render_to_xls(queryset, filename, fields): | |
""" | |
Output an XLS file of the queryset | |
Usage : | |
------- |
class AllowPUTAsCreateMixin(object): | |
""" | |
The following mixin class may be used in order to support PUT-as-create | |
behavior for incoming requests. | |
""" | |
def update(self, request, *args, **kwargs): | |
partial = kwargs.pop('partial', False) | |
instance = self.get_object_or_none() | |
serializer = self.get_serializer(instance, data=request.data, partial=partial) | |
serializer.is_valid(raise_exception=True) |
#!/usr/bin/env python | |
# sample usage: checksites.py eriwen.com nixtutor.com yoursite.org | |
import pickle, os, sys, logging | |
from httplib import HTTPConnection, socket | |
from smtplib import SMTP | |
def email_alert(message, status): | |
fromaddr = 'you@gmail.com' |
from django.db import models | |
class Member(models.Model): | |
# RE: null vs blank | |
# | |
# NULL https://docs.djangoproject.com/en/1.10/ref/models/fields/#null | |
# Avoid using null on string-based fields such as CharField and TextField because | |
# empty string values will always be stored as empty strings, not as NULL. | |
# |
#!/bin/env python | |
import sys | |
import SocketServer | |
import BaseHTTPServer | |
import SimpleHTTPServer | |
class ThreadingSimpleServer(SocketServer.ThreadingMixIn, | |
BaseHTTPServer.HTTPServer): |
from flask import Flask | |
from flask import request | |
import json | |
import requests | |
import hashlib as hasher | |
import datetime as date | |
node = Flask(__name__) | |
# Define what a Snakecoin block is | |
class Block: |