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
#!/bin/bash | |
function checkRoot { | |
if [ "$EUID" -ne 0 ] | |
then echo 請使用root帳號,或sudo指令執行 | |
return 1 | |
fi | |
return 0 | |
} | |
checkRoot || exit |
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
#!/bin/bash | |
function checkRoot { | |
if [ "$EUID" -ne 0 ] | |
then echo 請使用root帳號,或sudo指令執行 | |
return 1 | |
fi | |
return 0 | |
} | |
checkRoot || exit 1 |
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
gist的title是認檔名「字串排序」最小的為準,建立後將其他檔案改名或新增檔案都無效 | |
參考資料: | |
https://stackoverflow.com/questions/9536737/load-a-xml-file-from-the-classpath-in-a-spring-web-app | |
https://zetcode.com/spring/classpathresource/ |
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
#下載、安裝brew(如果需要 | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
#安裝git | |
brew install git | |
#在終端機上登入個人github帳號 | |
#下載前後端專案 | |
git clone https://github.com/104corp/y19fresh-lottery-program |
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
//c++想玩出不定維度陣列也是辦得到的,但是元素資料型態不固定大概就不行了。 | |
#include<iostream> | |
using namespace std; | |
template <typename T> | |
struct Node{ | |
T val; | |
Node* next; | |
Node* child; |
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 java.io.*; | |
import java.net.*; | |
public class ConnectWeb{ | |
public static void main(String[] args){ | |
http(); | |
https(); | |
} | |
static void https(){//https目前還是不行,試過網路上的code失敗 | |
String target = "https://gist.githubusercontent.com/Benjamin1021523/1701eb96206b779e1595ce0cc3f82466/raw/fc71033195bdec93457f39fe26cbef74701dcce2/Example.java"; |
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
/*參考自 | |
https://ithelp.ithome.com.tw/users/20065504/ironman/1259 | |
*/ | |
var 字串1 = '這是一個字串'; | |
var 字串2 = '這也是一個字串'; | |
console.log(字串1); | |
//可以用中文當變數名 | |
if(isNaN(parseInt(字串1))){ |
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 requests | |
from apscheduler.schedulers.blocking import BlockingScheduler | |
from datetime import datetime | |
def job(): | |
print("於{}開始抓取資料".format(datetime.now())) | |
requests.get('http://localhost/weather.php') | |
print("於{}結束抓取資料".format(datetime.now())) | |
job()#初次工作 |
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
<?php | |
set_time_limit(0); | |
header("Content-Type:text/html; charset=utf-8"); | |
date_default_timezone_set("Asia/Taipei"); | |
$CountryName = ["","基隆市", "新北市", "臺北市", "桃園市", "新竹市", "新竹縣", "苗栗縣", "臺中市", "彰化縣", "南投縣", "雲林縣", "嘉義市", "嘉義縣", "臺南市", "高雄市", "屏東縣", "宜蘭縣", "花蓮縣", "臺東縣", "金門縣", "連江縣", "澎湖縣"]; | |
$CountyToTown = array( | |
1 => array([13,"仁愛區","1001704"],[14,"信義區","1001707"],[15,"中正區","1001701"],[16,"中山區","1001705"],[17,"安樂區","1001706"],[18,"暖暖區","1001703"],[19,"七堵區","1001702"]), | |
2 => array([20,"萬里區","6502800"],[21,"金山區","6502700"],[26,"板橋區","6500100"],[27,"汐止區","6501100"],[28,"深坑區","6501800"],[29,"石碇區","6501900"],[30,"瑞芳區","6501200"],[31,"平溪區","6502400"],[32,"雙溪區","6502500"],[33,"貢寮區","6502600"],[34,"新店區","6500600"],[35,"坪林區","6502000"],[36,"烏來區","6502900"],[37,"永和區","6500400"],[38,"中和區","6500300"],[39,"土城區","6501300"],[40,"三峽區","6500900"],[41,"樹林區","6500700"],[42,"鶯歌區","6500800"],[43,"三重區","6500200"],[44,"新莊區","6500500"],[45,"泰山區","6501600"],[46,"林口區","6501700"],[47,"蘆洲區","6501400"],[48,"五股區","6501500"],[49,"八里區 |