- Style. Markup syntax, wrap margins, grammar, capitalization, punctuation. Spell these things out, remove the guesswork, and make it all as simple as possible. The end result will be a remarkably consistent log that's not only a pleasure to read but that actually does get read on a regular basis.
- Content. What kind of information should the body of the commit message (if any) contain? What should it not contain?
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
#!/usr/bin/env python | |
from __future__ import print_function | |
import sys | |
import argparse | |
import shlex | |
import subprocess | |
def main(argv): | |
DOWNLOAD_DIR = 'LOCAL_DOWNLOAD_DIR' | |
USER = 'REMOTE_USER_NAME' |
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 <bits/stdc++.h> | |
#define SZ(X) ((int)(X).size()) | |
#define ALL(X) (X).begin(), (X).end() | |
#define REP(I, N) for (int I = 0; I < (N); ++I) | |
#define REPP(I, A, B) for (int I = (A); I < (B); ++I) | |
#define RI(X) scanf("%d", &(X)) | |
#define RII(X, Y) scanf("%d%d", &(X), &(Y)) | |
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z)) | |
#define DRI(X) int (X); scanf("%d", &X) | |
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y) |
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
import random | |
class Pocket(object): | |
"""A pocket can hold up to 2 balls.""" | |
def __init__(self, num): | |
self.num = num | |
self.member = [] | |
self.limit = 2 | |
@property |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
-
HTML & CSS
-
HTML & CSS Advanced
-
JavaScript
-
JavaScript Advanced
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Cut list into chunks. | |
def chunk(to_cut,piece_number): | |
''' | |
Cut list into equalily distributed pieces. | |
''' | |
piece_len = len(to_cut)/piece_number | |
for i in xrange(0,len(to_cut),piece_len): | |
yield to_cut[i:i+piece_len] |
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
# SSLError: EOF occurred in violation of protocol | |
# https://github.com/kennethreitz/requests/issues/1083#issuecomment-11853729 | |
from requests.adapters import HTTPAdapter | |
from requests.packages.urllib3.poolmanager import PoolManager | |
import ssl | |
class MyAdapter(HTTPAdapter): | |
def init_poolmanager(self, connections, maxsize): | |
self.poolmanager = PoolManager(num_pools=connections, |
OlderNewer