http://www.infoq.com/presentations/JVM-Performance-Tuning-twitter (video & slides)
http://www.infoq.com/articles/9_Fallacies_Java_Performance (video & slides)
http://www.infoq.com/presentations/Visualizing-Java-GC (video & slides)
A good commit message looks like this:
Header line: explain the commit in one line (use the imperative)
Body of commit message is a few lines of text, explaining things
in more detail, possibly giving some background about the issue
being fixed, etc.
The body of the commit message can be several paragraphs, and
please do proper word-wrap and keep columns shorter than about
from sqlalchemy import create_engine | |
from sqlalchemy.orm import Session | |
from myapp.models import BaseModel | |
import pytest | |
@pytest.fixture(scope="session") | |
def engine(): | |
return create_engine("postgresql://localhost/test_database") |
# coding: utf-8 | |
# PYTHON IMPORTS | |
from django.utils import six | |
from django.core.exceptions import ImproperlyConfigured | |
# REST IMPORTS | |
from rest_framework.settings import api_settings | |
from rest_framework.filters import BaseFilterBackend |
""" | |
Test performance of these counting methods: | |
- count_if_else: Set to 1 if not yet seen and increment otherwise | |
- count_if: Set to 0 if not yet seen, then increment regardless of containment | |
- count_exception: Attempt to increment and set to 1 if KeyError caught | |
- count_setdefault: Set default value to 0, then increment | |
- count_fromkeys: Create dict with necessary keys set to 0, then increment each | |
- count_set_and_comprehension: Create dict of items and counts using a set | |
- count_defaultdict: Increment count, automatically setting unseen values to 0 |
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
#!/usr/bin/env python2.7 | |
# | |
# Send email without requiring account credentials to be stored on the | |
# Docker instance. | |
# | |
# Adapted from: | |
# https://moythreads.com/wordpress/2015/07/09/sending-email-with-python-without-an-mta/ | |
# | |
# Dependencies: | |
# `smtplib` (pip install smtplib to install) |
This is a guide on how to send a properly formatted multipart email. Multipart email strings are MIME encoded, raw text email templates. This method of structuring an email allows for multiple versions of the same email to support different email clients.
// Example Multipart Email:
From: [email protected]
To: [email protected]
Subject: Multipart Email Example
Content-Type: multipart/alternative; boundary="boundary-string"
pragma solidity ^0.4.8; | |
// Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d | |
library ECRecover { | |
// ECRecovery Methods | |
// Duplicate Solidity's ecrecover, but catching the CALL return value | |
function safer_ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal returns (bool, address) { |
# Put this file under /etc/spamassassin/ and run an sa-update or reload amavis etc. | |
# | |
#-------------------------------------------------- | |
# The only RBL I trust, UCEPROTECT1 (single IP, not IP-ranges or entire ISPs) http://uceprotect.net | |
#-------------------------------------------------- | |
header RCVD_IN_UCEPROTECT1 eval:check_rbl_txt('uceprotect1', 'dnsbl-1.uceprotect.net') | |
describe RCVD_IN_UCEPROTECT1 Listed in dnsbl-1.uceprotect.net | |
tflags RCVD_IN_UCEPROTECT1 net | |
score RCVD_IN_UCEPROTECT1 1.8 |