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
class File(object): | |
def __init__(self, file_name, method): | |
self.file_obj = open(file_name, method) | |
def __enter__(self): | |
return self.file_obj | |
def __exit__(self, type, value, traceback): | |
self.file_obj.close() |
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
const isArray = arr => Object.prototype.toString.call(arr) === '[object Array]' | |
const isObject = obj => Object.prototype.toString.call(obj) === '[object Object]' | |
/** | |
* Deep copy properties from src, and return cloned object | |
* @param {Object} src source object to clone from | |
*/ | |
const deepClone = src => { | |
const dest = {} | |
const copy = (src, dest) => { |
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 join from 'lodash/join' // es6, most useful when used with webpack. | |
const isArray = require('lodash/isArray') // node.js style. |
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
[global] | |
timeout = 60 | |
index-url = http://pypi.douban.com/simple | |
[install] | |
trusted-host=pypi.douban.com |
NewerOlder