Skip to content

Instantly share code, notes, and snippets.

View likidu's full-sized avatar
:octocat:
Focusing

Liki Du likidu

:octocat:
Focusing
View GitHub Profile
@likidu
likidu / rollup.config.js
Created November 24, 2022 02:48
Rollup config for building KaiOS v2.5 apps
import sveltePreprocess from 'svelte-preprocess';
import css from 'rollup-plugin-css-only';
import svelte from 'rollup-plugin-svelte';
import nodePolyfills from 'rollup-plugin-polyfill-node';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript';
import { babel } from '@rollup/plugin-babel';
import replace from '@rollup/plugin-replace';
@likidu
likidu / componentDidUpdate.tsx
Last active April 17, 2020 09:08
Use Preact with Typescript
const mounted = useRef();
useEffect(() => {
if (!mounted.current) {
mounted.current = true;
} else {
// do componentDidUpate logic
}
});

canvas-qr

qrcode creator based on node-canvas and qr-js

important: install Cairo first

install Cairo first, For system-specific installation view the Wiki from node-canvas

features

@likidu
likidu / git-list-merge-conflict-files.md
Created July 24, 2015 08:17
Git list merge conflict files

For a simple list

git diff --name-only --diff-filter=U

For all conflict places in a list

git ls-files -u

@likidu
likidu / likidu.com.conf
Created January 30, 2015 03:56
Deploy morpheus with Nginx and PM2
server
{
listen 80;
#listen [::]:80;
server_name likidu.com www.likidu.com;
index index.html index.htm;
root /home/wwwroot/likidu.com;
include none.conf;
#error_page 404 /404.html;
@likidu
likidu / wechat.io.conf
Last active September 15, 2018 15:23
Nginx Settings for NodeJS App
# Nginx Reverse Proxy for NodeJS Apps
server
{
listen 80;
server_name wechat.io;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/wechat.io;
include none.conf;
if ($http_host != "wechat.io") {