Skip to content

Instantly share code, notes, and snippets.

didyhu

Block or report user

Report or block didyhu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Run Node on Docker.md

Run Node on Docker

Config

  1. Dockerfile
    FROM node:{NODE_VER}
    WORKDIR /opt/app
    COPY ./package*.json ./*.lock ./
    RUN yarn --only-production
    
View Table_and_Flex_layout_examples.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Table & Flex layout examples</title>
</head>
View Webpack Dev Evniroment.md

Webpack Develop Enviroment

install

yarn add babel-loader @babel/core @babel/preset-env webpack webpack-cli webpack-dev-server

run

@didyhu
didyhu / change-windows-network-category.md
Created Nov 27, 2019
Change Windows NetworkCategory
View change-windows-network-category.md
Set-NetConnectionProfile -InterfaceIndex %Index% -NetworkCategory 'Private|Public'
View allow-cors.md

Allow CORS

server

// listens foo.com:1234
app.use((req, res, next) => {
    res.header("Access-Control-Allow-Origin", "*")
    res.header("Access-Control-Allow-Methods", "GET, POST, PUT")
    next()
View nginx-conf.md

nginx-conf

Forbidden default

server{
  listen 80 default_server;
  listen [::]:80 default_server;

  server_tokens off;
View systemd-service.md

Systemd service

sudo vi /etc/systemd/system/foo.service
#/etc/systemd/system/foo.service
[Unit]
Description=DESCRIPTION
View linux-swap.md

Linux Swap

# 1. generate an empty file
$ dd if=/dev/zero of=/var/swapfile bs=1M count=1024
# 2. format it as swap
$ mkswap /var/swapfile 
# 3. turn on it
$ swapon /var/swapfile
# 4. make it works after boot
@didyhu
didyhu / windows-pyopencl.md
Last active Jan 23, 2019
Windows 环境下搭建 PyOpenCL
View windows-pyopencl.md
  1. 下载驱动 Nvidia
https://developer.nvidia.com/opencl
  1. 安装 pybind11
py -3 -m pip install pybind11
  1. 安装 pyopencl
View tech-route.md
  • Version Control
    • Git
    • GitHub
    • OsChina
      • Issue
  • Language
    • Java SE
      • Functional Programming
      • Stream
      • Date
You can’t perform that action at this time.