This file contains hidden or 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
| type Len<T extends any[]> = T["length"] | |
| type _Add< | |
| T, | |
| N1 extends Number, | |
| N2 extends Number, | |
| Curr1 extends any[], | |
| Curr2 extends any[] | |
| > = Len<Curr1> extends N1 | |
| ? Len<Curr2> extends N2 |
This file contains hidden or 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, { useEffect, useRef, useState } from "react"; | |
| import mermaidAPI from "mermaid"; | |
| type Props = { | |
| divId: string; | |
| children: string; | |
| }; | |
| export default function Mermaid({ children }: Props) { | |
| const [html, setHtml] = useState<string>(""); |
This file contains hidden or 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
| # Create Google Compute Engine Instance | |
| $ gcloud deployment-manager deployments create app-server --config ./config/vm.yaml | |
| # Connect to the instance | |
| $ gcloud compute ssh app-server | |
| # Create app-user | |
| $ sudo adduser app-user | |
| $ sudo usermod -a -G google-sudoers app-user |
This file contains hidden or 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
| # | |
| #=Ruby Cheat Sheet for Beginner | |
| # | |
| ################################################## | |
| # 複数行コメント | |
| ################################################## | |
| =begin | |
| コメント |
This file contains hidden or 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
| # | |
| #=Ruby Cheat Sheet for Beginner | |
| # | |
| ################################################## | |
| # 複数行コメント | |
| ################################################## | |
| =begin | |
| コメント |
This file contains hidden or 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
| #include <iostream> | |
| #include <vector> | |
| #include <map> | |
| #include <climits> | |
| using namespace std; | |
| typedef pair<int, int> Edge; | |
| typedef map<int, int> Vertex; | |
| typedef vector<Vertex> Graph; |
This file contains hidden or 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
| (defparameter *problem-num* 10) | |
| (if (> (length *args*) 0) (defparameter *problem-num* (parse-integer (car *args*)))) | |
| (setf *random-state* (make-random-state t)) | |
| (defun rand-elt (lst) (elt lst (random (length lst)))) | |
| (defun rand-range (min max) (let ((r (random (- max min)))) (+ r min))) | |
| (defun 1+rand (m) (1+ (random m))) | |
| (defun divisor-lst (num mindiv maxdiv) | |
| (let ((lst '())) | |
| (do ((n mindiv (1+ n))) | |
| ((or (>= n num) |
NewerOlder