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.
#!/usr/bin/python | |
""" | |
This code is part of ros package that subscribes to an image topic | |
and detects smiles found in the image. Results are then republished to a ros | |
image topic. | |
This node is an example of how I prefer to write my ROS nodes, as a single | |
class with a run function. |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import hashlib as hasher | |
import datetime as date | |
class Block: | |
def __init__(self, index, timestamp, data, previous_hash): | |
self.index = index | |
self.timestamp = timestamp |
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: |
#!/bin/env python | |
import sys | |
import SocketServer | |
import BaseHTTPServer | |
import SimpleHTTPServer | |
class ThreadingSimpleServer(SocketServer.ThreadingMixIn, | |
BaseHTTPServer.HTTPServer): |
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. | |
# |
#!/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' |
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) |
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 : | |
------- |
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; |