Skip to content

Instantly share code, notes, and snippets.

Quinn Sheng a1exlism

Block or report user

Report or block a1exlism

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 random_numbers.cpp
/*
* 生成在[a, b]范围内的随机数据
* Random numbers in the range of [a,b]
*/
#include <cstdio>
#include <cstdlib>
#include <ctime>
const int MAXN = 1000;
int main() {
int arr[MAXN];
View binary_sarch.cpp
/*
* INPUT: 100 \n
* TIPS: 输入必须有序, 否则pos无意义
* 1 10 11 11 12 12 13 15 16 18 2 2 20 20 20 20 21 21 21 22 22 22 23 23 23 23 24 24 24 24 24 27 27 28 32 35 4 40 40 40 41 42 44 44 46 47 47 5 5 52 53 54 57 58 6 60 61 62 62 63 63 64 65 65 65 69 7 70 70 71 71 72 75 75 76 77 8 8 82 84 84 85 86 86 87 89 9 9 91 91 93 93 95 95 96 97 97 98 98 99
* Search X \n
* OUTPUT: position of X
*/
#include <cstdio>
#include <algorithm>
using namespace std;
View NQueens.cpp
/*
* N 皇后问题 - Recursion 方案
* 实质也是排列组合Permutation问题
*/
#include <cstdio>
#include <cmath>
using namespace std;
const int MAXN = 10; // 最多8*8 八皇后
int n = 0; // n 皇后
View Docker_Quick_starter.md

workflow

0?. docker search image

  1. docker pull image
  2. docker images
  3. docker run container
  4. docker ps -a
  5. docker stop container
  6. docker rm dockerID
@a1exlism
a1exlism / command.sh
Last active Apr 25, 2019 — forked from peterdemartini/command.sh
Exclude node_modules in timemachine
View command.sh
find $(pwd) -type d -name node_modules -prune -exec tmutil addexclusion {} \;
# my pwd is /Users/a1exlism/workspace
View shell_ln_symbol_attention.shell
# ln -s Refer
# http://mrhopehub.github.io/2014/04/27/ln.html
# 1. Recommand | use both ABSOLUTE path when using ln -s command
ln -s /absolute/path/source /absolute/path/output
# 2. Relative directory | source`$1` is relative the output path`$2`
ln -s /relative/to/output(which is `SOURCE`) /absolute/path/output
# NOT Recommand | More specific example: ln /tmp/dir1/source TO /tmp/dir2/output
View innderHTMLCode.php
<?php
print <<<EOT
<!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">
View shell_dirctor.sh
# Link: https://unix.stackexchange.com/questions/77007/mv-cannot-stat-no-such-file-or-directory-in-shell-script
# Failed
mv /path/to/FILE /new/path/to/FILE
# Double Quote the directory
mv "/path/to/"FILE "/new/path/to/"FILE
View MySQL_legacy_password.sql
ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY 'PASSWORD';
View mac_apache_server.md
You can’t perform that action at this time.