Skip to content

Instantly share code, notes, and snippets.


Yang He abruzzihraig

View GitHub Profile
View docker-etcd-compose.yml
version: '2'
restart: always
- 23791:2379
- 23801:2380
xameeramir / default nginx configuration file
Last active Jun 14, 2021
The default nginx configuration file inside /etc/nginx/sites-available/default
View default nginx configuration file
## Personal note: Muslims are not terrorists and I humbly request my engineering community to help end racism.
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
sanjeevshrestha / telegraf-dockercompose.yml
Last active May 12, 2021
Telegraf Docker Compose file
View telegraf-dockercompose.yml
image: telegraf
restart: always
HOST_PROC: /rootfs/proc
HOST_SYS: /rootfs/sys
HOST_ETC: /rootfs/etc
hostname: localhost
- ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
vlucas / encryption.js
Last active Jun 15, 2021
Stronger Encryption and Decryption in Node.js
View encryption.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
idiotWu / themr.js
Last active Mar 29, 2017
Another theme-able solution for react reusable components.
View themr.js
* Usage:
* As a decorator:
* import defaultTheme from './style.scss';
* @themr(defaultTheme)
* class Comp extends React.Component { ... }
abruzzihraig / angular-amap.js
Last active Jul 5, 2016
AMap/高德地图 module wrapper with angular
View angular-amap.js
* The module amap below is a simplest implementation, there is no any updated or proper libraries when I wrote it.
* Since there is a new full-feature library which wrote by another guy, so I just recommend it below.
* If you just want version with a few features like below, you could just build your version on top of it.
angular.module('amap', [])
.constant('amapConstant', {
idiotWu / attach-events.js
Last active Oct 6, 2017
attach-events decorator for react
View attach-events.js
* @decorator
* Attach events to DOM element
* @param {Element|Function} elemOrFunc: DOM Element, or a function returns element
* @param {String} events: a list events separated with ','
* Usage:
* @attachEvents(window, 'click')
* handleWindowClick(evt) {
bjhomer /
Last active Dec 27, 2017
How to make the Day One command line tool automatically write to Day One 2

Using the Day One CLI with Day One 2

The dayone command line tool was originally written to work with Day One Classic, and by default writes its entries to the default Day One Classic journal directory1. If you want to use the dayone tool to write entries in to Day One 2 instead, there are a couple options.

Option 1. Use this option if you don't use Day One Classic at all.

btroncone /
Last active Jun 16, 2021
RxJS 5 Operators By Example
kryss / 撤掉X5情愿书
Last active Apr 30, 2021
View 撤掉X5情愿书
导致我们的应用在安卓版上完全无法使用 REST H5特效。