Skip to content

Instantly share code, notes, and snippets.

View lisasu-g's full-sized avatar
👋
Hi, What's up?

Lisa lisasu-g

👋
Hi, What's up?
View GitHub Profile
@tobybellwood
tobybellwood / php8.0.Dockerfile
Created November 27, 2020 02:14
PHP8.0 Dockerfile with all options
ARG IMAGE_REPO
FROM ${IMAGE_REPO:-lagoon}/commons as commons
FROM composer:latest as healthcheckbuilder
RUN composer create-project --no-dev amazeeio/healthz-php /healthz-php v0.0.6
FROM php:8.0.0RC5-fpm-alpine3.12
LABEL maintainer="amazee.io"
@thchia
thchia / combineUseReducers.js
Last active March 27, 2023 10:15
Combining the useReducers Hook
// Main
function combineReducers(reducerDict) {
const _initialState = getInitialState(reducerDict);
return function(state = _initialState, action) {
return Object.keys(reducerDict).reduce((acc, curr) => {
let slice = reducerDict[curr](state[curr], action);
return { ...acc, [curr]: slice };
}, state);
};
}
@robhrt7
robhrt7 / MySQL_5-7_macOS.md
Last active February 28, 2024 03:48 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active June 10, 2024 13:31
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@mfalkvidd
mfalkvidd / nginx-thingsboard
Last active February 7, 2024 17:02
Thingsboard nginx reverse proxy with websocket and HTTPS support (Let's Encrypt)
server {
listen 80;
server_name EXTERNAL_THINGSBOARD_DOMAIN.com;
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
}
server {
#!/usr/bin/env python2
# lrdcq
# usage python2 unwxapkg.py filename
import sys, os
import struct
class WxapkgFile(object):
nameLen = 0
var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
@bydmm
bydmm / xinde.md
Last active October 18, 2022 09:59
PM2任务管理器用作定时任务的心得

PM2是一款用nodejs实现的进程管理器,本身功能比较强大,在CLI下的指令都比较好用。 PM2可将各种各样的程序维持在后台,不仅仅是nodejs,还可以是ruby,python,java等。其主要使用方法是编写一个描述文件,来描述PM2如何运行你想要的程序。

http://pm2.keymetrics.io/docs/usage/application-declaration/

可惜PM2本身是一款针对持续后台任务'deamon'而设计的管理器,对运行一次就要退出的‘task’不是很友好,所以特写此文纪念逝去的时光。

想让PM2帮你跑定时任务的话,有以下两种两种方法。这两种方法各有利弊,请自行取舍。

一, 自动重启法

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment