This file contains hidden or 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 getAstro(m, d) { | |
return "魔羯水瓶双鱼牡羊金牛双子巨蟹狮子处女天秤天蝎射手魔羯".substr(m*2-(d<"102123444543".charAt(m-1)- -19)*2,2); | |
} |
This file contains hidden or 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
// In task configuration, use `expand: true` and `rename: stripVersion` | |
var stripVersion = function (dest, src) { | |
var path = require('path'); | |
return path.join(dest, src.replace(/-\d+\.\d+\.\d+(\.min)?/, '')) | |
} |
This file contains hidden or 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
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -U |
This file contains hidden or 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
def convert(ordinal): | |
"""Convert Excel Date type""" | |
sd = datetime.date(1899, 12, 31) - datetime.timedelta(days=1) | |
return datetime.datetime.fromordinal(int(ordinal) + sd.toordinal()) |
This file contains hidden or 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
from itertools import chain, tee, izip | |
# A | |
def pairwise(iterable): | |
"s -> (s0,s1), (s1,s2), (s2, s3), ..." | |
a, b = tee(iterable) | |
next(b, None) | |
return izip(a, b) | |
This file contains hidden or 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
[Unit] | |
Description=High-performance, schema-free document-oriented database | |
After=syslog.target network.target | |
[Service] | |
Type=forking | |
User=mongod | |
PIDFile=/var/run/mongod/mongod.pid | |
EnvironmentFile=/etc/sysconfig/mongod | |
ExecStart=/usr/bin/mongod -f /etc/mongod.conf run |
This file contains hidden or 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
# -*- coding:utf-8 -*- | |
import sys | |
import time | |
import math | |
import re | |
import telnetlib | |
import random | |
from collections import namedtuple, defaultdict |
This file contains hidden or 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 <stdio.h> | |
#include <stdint.h> | |
/** Time relative to server start. Smaller than time_t on 64-bit systems. */ | |
typedef unsigned int rel_time_t; | |
typedef struct _stritem { | |
struct _stritem *next; | |
struct _stritem *prev; | |
struct _stritem *h_next; /* hash chain next */ |
This file contains hidden or 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
# Nginx log format | |
log_format main '$remote_addr\t$remote_user\t$time_local\t$request_time\t$request\t' | |
'$status\t$body_bytes_sent\t$http_referer\t' | |
'$http_user_agent\t$http_x_forwarded_for'; | |
# GoAccess configuration | |
# IMPORTANT: Replace all `\t` below with real tabs | |
date_format %d/%b/%Y:%T | |
log_format %h\t%^\t%d %^\t%T\t%r\t%s\t%b\t%R\t%u\t%^ |
This file contains hidden or 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
[user] | |
name = Codeb Fan | |
email = [email protected] | |
[push] | |
default = simple | |
[core] | |
editor = vim | |
[diff] | |
tool = vimdiff | |
ignoreSubmodules = dirty |