Git 比较不同版本文件差异的常用命令格式:
git diff 查看尚未暂存的文件更新了哪些部分
git diff filename 查看尚未暂存的某个文件更新了哪些
git diff –cached 查看已经暂存起来的文件和上次提交的版本之间的差异
git diff –cached filename 查看已经暂存起来的某个文件和上次提交的版本之间的差异
| // See: http://stackoverflow.com/questions/17218089/salt-and-hash-using-pbkdf2 | |
| // See: https://crackstation.net/hashing-security.htm | |
| 'use strict'; | |
| let Promise = require('bluebird'); | |
| let crypto = require('crypto'); | |
| function calcPassword(password) { | |
| const RANDOM_BYTES = 64; |
| import yaml | |
| from rest_framework.compat import coreapi, urlparse | |
| from rest_framework.schemas import SchemaGenerator | |
| from rest_framework_swagger import renderers | |
| from rest_framework.response import Response | |
| from rest_framework.views import APIView | |
| from rest_framework import exceptions | |
| from rest_framework.permissions import AllowAny |
| def AbstractClassWithoutFieldsNamed(cls, *excl): | |
| """ | |
| Removes unwanted fields from abstract base classes. | |
| Usage:: | |
| >>> from oscar.apps.address.abstract_models import AbstractBillingAddress | |
| >>> from koe.meta import AbstractClassWithoutFieldsNamed as without | |
| >>> class BillingAddress(without(AbstractBillingAddress, 'phone_number')): | |
| ... pass |
Git 比较不同版本文件差异的常用命令格式:
git diff 查看尚未暂存的文件更新了哪些部分
git diff filename 查看尚未暂存的某个文件更新了哪些
git diff –cached 查看已经暂存起来的文件和上次提交的版本之间的差异
git diff –cached filename 查看已经暂存起来的某个文件和上次提交的版本之间的差异
| /** | |
| * RuntimeGlobalsChecker | |
| * | |
| * You can use this utility to quickly check what variables have been added (or | |
| * leaked) to the global window object at runtime (by JavaScript code). | |
| * By running this code, the globals checker itself is attached as a singleton | |
| * to the window object as "__runtimeGlobalsChecker__". | |
| * You can check the runtime globals programmatically at any time by invoking | |
| * "window.__runtimeGlobalsChecker__.getRuntimeGlobals()". | |
| * |
| # Y Combinator in Python | |
| # See <http://d.hatena.ne.jp/nowokay/20090409#1239268405> | |
| true = lambda x: lambda y: x | |
| false = lambda x: lambda y: y | |
| # `bool` to `true|false` | |
| # | |
| # >>> boolean(3 < 4)(2)(5) | |
| # 2 |
| import datetime | |
| from django.conf import settings | |
| from django.contrib.auth import logout | |
| from django.contrib.auth.models import User | |
| from django.contrib.sessions.models import Session | |
| from django.http import HttpRequest | |
| from django.utils.importlib import import_module |
| import fcntl | |
| from contextlib import contextmanager | |
| @contextmanager | |
| def flocked(fd): | |
| """ Locks FD before entering the context, always releasing the lock. """ | |
| try: | |
| fcntl.flock(fd, fcntl.LOCK_EX) | |
| yield | |
| finally: |
To install tcptraceroute on Debian/Ubuntu:
$ sudo apt-get install tcptracerouteTo install tcptraceroute on CentOS/REHL, first set up RepoForge on your system, and then:
$ sudo yum install tcptraceroute| /** | |
| Any server would do as long as there is a path that sets a cookie named devtools | |
| **/ | |
| //@ts-ignore | |
| import { Bun } from 'bun'; | |
| import fs from "fs"; | |
| export default { | |
| port: 3000, |