Skip to content

Instantly share code, notes, and snippets.

@jesseincn
jesseincn / gist:73c0e5d54af3baea8bbf
Last active August 29, 2015 14:05
bootstrap提示框
G.ui.tips.suc(data.msg);
G.ui.tips.err(data.msg);
G.ui.tips.confirm_flag('您确定吗?',function(){});
@jesseincn
jesseincn / gist:ff5a4fb0f1ad71f2312d
Last active August 29, 2015 14:05
jquery判断checkbox是否被选中
if ($("#readme").attr("checked") != "checked") {
alert("hello");
return;
}
@jesseincn
jesseincn / gist:e233f948a9f0e17e6302
Created August 29, 2014 15:40
Javascript刷新页面的几种方法
history.go(0)
location.reload()
location=location
location.assign(location)
document.execCommand('Refresh')
window.navigate(location)
location.replace(location)
document.URL=location.href
if(confirm("确定要清空数据吗?"))
return true;
@jesseincn
jesseincn / gist:a95973318ba7907b179a
Created September 2, 2014 06:51
iphone 微信浏览器头信息
Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Mobile/11D257 MicroMessenger/5.4 NetType/WIFI
@jesseincn
jesseincn / gist:d993b4b9ebfc174a4144
Last active August 29, 2015 14:06
Oracle自增列创建方法
Oracle没有自增字段这样的功能,但是通过触发器(trigger)和序列(sequence)可以实现。
先建一个测试表了:
create table userlogin
(
id number(6) not null,
name varchar2(30) not null primary key
@jesseincn
jesseincn / gist:d276958e61ca7f14d507
Last active August 29, 2015 14:06
添加和编辑共用一个下拉列表
<select name="role" id="role">
<option value="">请选择角色</option>
<?php foreach ($roles as $role):?>
<option value="<?php echo $role->ID ?>" <?php if(isset($uinfo)){echo ($uinfo['ID']==$role->ID)?'selected=selected':'';} ?> ><?php echo $role->NAME ?></option>
<?php endforeach;?>
</select><span class="maroon">*</span>
@jesseincn
jesseincn / gist:b84c486a623ca66ff1fa
Created September 22, 2014 15:43
win7设置电脑定时关机
win7里面有自带的关机程序,在Windows\System32\Shutdown.exe。
可以直接打开这个可执行应用程序,也可以选择“开始→运行”,比如你的电脑要在22:00关机,输入“at 22:00 Shutdown -s”, 到了22点电脑就会出现“系统关机”对话框,默认有30秒钟的倒计时并提示你保存工 作。如果你想以倒计时的方式关机,可以输入“Shutdown.exe -s -t 3600”,这里表示60 分钟后自动关机,“3600”代表60分钟。
设置好自动关机后,如果想取消的话,可以在运行中输入“shutdown -a”。另外输入
“shutdown -i”,则可以打开设置自动关机对话框,对自动关机进行设置。
Shutdown.exe的参数,每个都具有特定的用途,执行每一个都会产生不同的效果,比如
“-s”就表示关闭本地计算机,“-a”表示取消关机操作,-f:强行关闭应用程序
-m \\计算机名:控制远程计算机
-i:显示图形用户界面,但必须是Shutdown的第一个选项
-l:注销当前用户
-r:关机并重启
@jesseincn
jesseincn / gist:b7a9da34ac88582bfbc9
Created September 23, 2014 04:17
HTML显示平方米
元/m<sup>2</sup>
@jesseincn
jesseincn / gist:d0cbd2dddadfd3c91eb0
Last active August 29, 2015 14:06
批量清除目录下的文件BOM头clearbom.php
<?php
if (isset($_GET['dir'])){ //设置文件目录
$basedir=$_GET['dir'];
}else{
$basedir = '.';
}
$auto = 1;
checkdir($basedir);
function checkdir($basedir){
if ($dh = opendir($basedir)) {