- commit-msg: add ticket id from current branch name to the commit message
- pre-push: check if CHANGELOG.md has been changed and prompts a warning message if not
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
// **************************** | |
//* ********* OUTPUT ********** | |
//* **** 20X Improvement ****** | |
//* ******** Tested on ******** | |
//* ****** Node v10.14.2 ****** | |
// **************************** | |
// Start testing : Original | |
// Original, #0: 1299.590ms | |
// Original, #1: 1268.201ms | |
// Original, #2: 1261.733ms |
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 E(BaseException): | |
def __new__(cls, *args, **kwargs): | |
return cls | |
def a(): yield | |
a().throw(E) |
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
FROM nginx:alpine AS builder | |
# nginx:alpine contains NGINX_VERSION environment variable, like so: | |
# ENV NGINX_VERSION 1.15.0 | |
# Our NCHAN version | |
ENV NCHAN_VERSION 1.1.15 | |
# Download sources | |
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \ |
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 sys | |
def j(lineno): | |
frame = sys._getframe().f_back | |
called_from = frame | |
def hook(frame, event, arg): | |
if event == 'line' and frame == called_from: | |
try: | |
frame.f_lineno = lineno |
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 discord | |
import asyncio | |
client = discord.Client() | |
@client.event | |
async def on_ready(): | |
print('Logged in as') | |
print(client.user.name) | |
print(client.user.id) |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
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 | |
# -*- coding: utf-8 -*- | |
"""This module's docstring summary line. | |
This is a multi-line docstring. Paragraphs are separated with blank lines. | |
Lines conform to 79-column limit. | |
Module and packages names should be short, lower_case_with_underscores. | |
Notice that this in not PEP8-cheatsheet.py |
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
package main | |
import ( | |
"io/ioutil" | |
"os/exec" | |
"fmt" | |
) | |
// EXAMPLE: echo "Subject: TestnHello" | sendmail -f [email protected] [email protected] | |
// Useful Links: https://gobyexample.com/spawning-processes |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
NewerOlder