- run certbot
sudo certbot --nginx -d mydomain.com -d mysubdomain.mydomain.com
- go
/etc/nginx/sites-available/default
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
::param 1 is executable, param 2 is timeout seconds | |
echo "running %1 with timeout %2" | |
start %1 | |
set time=0 | |
:check | |
tasklist /FI "IMAGENAME eq %1" 2>NUL | find /I /N "%1">NUL | |
::time limit exceed | |
if "%time%"=="%2" goto kill | |
::program is running | |
if "%ERRORLEVEL%"=="0" ( ping 127.0.0.1 -n 2 >nul & set /a time=%time%+1 & goto check) else ( goto end) |
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
--play at http://tw.gamelet.com/mission.do?code=csArena&gltParam=%7B%27mode%27%3A%27userMission%27%2C+%27id%27%3A%27270136%27%7D | |
--請不要更改第1至第1行的程式碼 | |
require "sys.game" | |
if level == nil then | |
--請在此初始化你的程式 | |
elseif level == 1 then | |
--第一關目標:說出 hello world |
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
--play at http://tw.gamelet.com/mission.do?code=csArena&gltParam=%7B%27mode%27%3A%27userMission%27%2C+%27id%27%3A%27270136%27%7D | |
--請不要更改第1至第1行的程式碼 | |
require "sys.game" | |
if level == nil then | |
--請在此初始化你的程式 | |
elseif level == 1 then | |
--第一關目標:說出 hello world |
fieldName: (parent, args, context, info) => data;
Sometimes we are not interested in getting all values of a node, we can do some tricks to prevent loading extra contents or generating infinite circular structure. Below example the users have many books, and each book have one owner, which is a user again. How can we query the user without returning the books, or reuse the node resolver if we want to return the books?
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
window.setInterval(() => document.querySelector('[aria-label="勁正"]').click(), 1000) |
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 React, { useCallback, useEffect, useRef, useState } from 'react' | |
import * as THREE from 'three' | |
export const ThreeViewer = () => { | |
const root = useRef<HTMLDivElement>(null) | |
const [{ renderer, camera }, set3] = useState<{ renderer?: THREE.Renderer, camera?: THREE.PerspectiveCamera }>({}) | |
const resize = useCallback((): void => { | |
const div = root.current | |
if (div !== null && renderer !== undefined && camera !== undefined) { | |
camera.aspect = div.clientWidth / div.clientHeight |
OlderNewer