Skip to content

Instantly share code, notes, and snippets.

View chang180's full-sized avatar
😳
."_".

張 建文 chang180

😳
."_".
  • New Taipei City
View GitHub Profile
@chang180
chang180 / calPi.php
Last active March 22, 2020 11:01
PI calculation
<?php
// 圓周率計算,以蒙地卡羅演算法處理
function calPi($num){
$c=0;
$s=0;
for($i=1;$i<=$num;$i++){
if(sqrt(pow(rand(0,$num),2)+pow(rand(0,$num),2)) <= $num ){
$c+=1;
$s+=1;
@chang180
chang180 / today
Created March 23, 2020 07:14
JavaScrpit output date
<script language="javascript">
 var Today=new Date();
 document.write(Today.getFullYear()+ "/" + (Today.getMonth()+1) + "/" + Today.getDate());
</script>
@chang180
chang180 / lottery.php
Created March 25, 2020 13:28
威力彩_php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>威力彩_php</title>
</head>
<body>
<h2>
<?php
@chang180
chang180 / rev
Last active March 26, 2020 04:21
中文字串反轉
$str = '字串反轉';
function rev($str, $encoding = 'utf-8'){
$len = mb_strlen($str);
$result = '';
for ($i = $len-1; $i>=0; $i--){
$result.= mb_substr($str,$i,1,$encoding);
}
return $result;
}
echo rev($str);
@chang180
chang180 / diamond.html
Last active March 27, 2020 13:04
印星星-菱形
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
@chang180
chang180 / cloudSettings
Created May 15, 2020 15:14
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-05-15T15:14:07.238Z","extensionVersion":"v3.4.3"}
@chang180
chang180 / History\-10007169\entries.json
Last active August 23, 2023 12:45
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///d%3A/neweb/lc-example/resources/views/charts.blade.php","entries":[{"id":"HMul.php","timestamp":1664180179899},{"id":"V5gB.php","timestamp":1664180200840},{"id":"eKnp.php","timestamp":1664180216801},{"id":"adGX.php","timestamp":1664181370358},{"id":"rk8v.php","timestamp":1664181383504},{"id":"DXBX.php","timestamp":1664181800697},{"id":"qtni.php","timestamp":1664185617554},{"id":"YTCA.php","source":"undoRedo.source","timestamp":1664185625072},{"id":"mRM2.php","timestamp":1664185639307}]}
@chang180
chang180 / laughing-man.svg
Created August 25, 2021 14:44 — forked from johan/laughing-man.svg
The Laughing Man (Ghost in the Shell), 1000 byte SVG :-)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.