Skip to content

Instantly share code, notes, and snippets.

@winwu
winwu / Org_chart_practice
Last active July 25, 2018 01:15
用html/css/js畫出組織圖
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Org_chart_practice</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<style>
body{font-family:arial;background:rgb(255, 247, 236)}
#org_chart{width:auto}
#org_chart ul{max-width:200px;min-width:150px;}
@winwu
winwu / three001.html
Last active December 19, 2015 06:19
學習three.js 20130702
<!DOCTYPE HTML>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<title>我的第一個three.js</title>
<style>
canvas{width:100%; height:100%}
</style>
</head>
<body>
@winwu
winwu / three002.html
Created July 2, 2013 15:38
學習three.js 002
<!DOCTYPE HTML>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<title>我的第一個three.js-002.html</title>
<style>
canvas{width:100%; height:100%}
</style>
</head>
<body>
@winwu
winwu / three003.html
Last active December 19, 2015 06:19
學習three.js
<!DOCTYPE HTML>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<title>我的第一個three.js-003.html</title>
<style>
canvas{width:100%; height:100%}
</style>
</head>
<body>
<!DOCTYPE HTML>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<title>我的第一個three.js-004.html</title>
<style>
canvas{width:100%; height:100%}
</style>
</head>
<body>
@winwu
winwu / three_with_dae.html
Last active December 19, 2015 09:39
學習如何將.eae匯入到畫面
<!DOCTYPE HTML>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<title>如何匯入sketchp的物件到three.js</title>
<style>
canvas{width:100%; height:100%}
h1{background:url(logo.png) no-repeat;height:80px;width:560px}
body{background:url(bg.png) no-repeat left 80%;margin:0 50px}
</style>

#我的 Vim 指令筆記

##vim 的三種模式 ###模式

  • 輸入模式:輸入內文。
  • 指揮模式:也叫指令模式,主要是進入到可以對文件做修改,複製,剪下貼上,游標移動等動作。
  • 執行模式:文件存檔,離開等等行為。

###常用模式的切換

  • 輸入模式 -> 指揮模式 : 鍵盤 Esc
@winwu
winwu / BMI值計算
Last active December 25, 2015 06:09
shell script 練習
#!/bin/bash
read -p "How about your Height(cm)?" height
read -p "How about your Weight(kg)?" weight
echo "your height is $height cm"
echo "your weight is $weight kg"
#because i need chage height's cm to m, and 1m = 100cm
m=100
height=`echo "scale=2; $height / $m"|bc`
@winwu
winwu / img_onerror_detect.js
Last active December 25, 2015 14:19
403 圖片偵測
$(function () {
$('img').bind('load readystatechage error', function (e) {
//綁定 load, readystatechage error三個事件,
//不過只有error在這裡會用到 :P
var e = e.type;
switch(e){
case 'error':
console.log('抓不到圖');
$(this).attr('src','/images/no_img.png');
break;
@winwu
winwu / img_onerror_detect_enhance.js
Created October 15, 2013 12:25
403 圖片偵測加強版(ajax偵測)
function detect_if_image_loaded(){
$('img').bind('error', function (e) {
var e = e.type;
switch(e){
case 'error':
$(this).attr('src','/images/no_img.png');
break;
}
});
}