Skip to content

Instantly share code, notes, and snippets.

View markyun's full-sized avatar
😮‍💨
代码成就万世基积沙镇海

云云酱 markyun

😮‍💨
代码成就万世基积沙镇海
View GitHub Profile
@markyun
markyun / gist:7972988
Created December 15, 2013 13:18
考场程序1
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<string>
#include<cmath>
#include<vector>
#include<queue>
#include<set>
@markyun
markyun / gist:7956209
Last active June 26, 2018 02:30
页面性能优化、 Javascript性能优化
document.getElementsByTagName('*').length 可以查看DOM元素的数量
前端开发的出品建议:
1、页面能够通过http://validator.w3.org的验证,当然css希望也能通过http://jigsaw.w3.org/css-validator/validator难证,不过有时候由于需要兼容多浏览器,会受到hack的影响,css不做强制要求。
2、静态页面应该能够通过yslow2.0的classic(V1)级别的检测,检测的结果我觉得应该得到A。
3、背景图片保证不超过3个以上,css文件不超过2个,js文件不超过3个。而且良好的遵守web标准的一些规定,css放到head中,js文件放到</body>之前或者之后。
@markyun
markyun / gist:7938614
Last active December 31, 2015 05:09
linux 和unix 下 常用命令
//修改ip地址
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT="yes"
BOOTPROTO=none
IPADDR="192.168.1.80"
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
TYPE=Ethernet
USERCTL=no
@markyun
markyun / gist:7907294
Last active December 31, 2015 00:29
HTML css兼容
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>CSS Hacks</title>
<style type="text/css">
li {
background-color: green;
font-size: 1.5em;
font-weight: bold;
color: white;
@markyun
markyun / gist:7904731
Created December 11, 2013 03:33
省市区下拉框,多级选择.js插件
/*
* jquery.regionselector2.js
* Description: 省市区下拉框,多级选择
*/
(function($) {
$.fn.extend({
regionselector2: function(options) {
//A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
//参数默认值
@markyun
markyun / gist:7801869
Last active December 30, 2015 08:19
Validate.js
/*
Name: 简单表格验证
Author: markyun
Email:markyun0802@gmail.com
Author URL: http://weibo.com/920802999
Version: 1.0
UpdateTime:2013-12-5
*/
//刷新图片验证码
@markyun
markyun / gist:7783755
Created December 4, 2013 07:47
Css hack
/***** Selector Hacks ******/
/* IE6 and below */
* html #uno { color: red }
/* IE7 */
*:first-child+html #dos { color: red }
/* IE7, FF, Saf, Opera */
html>body #tres { color: red }
/* IE8, FF, Saf, Opera (Everything but IE 6,7) */
html>/**/body #cuatro { color: red }
/* Opera 9.27 and below, safari 2 */
@markyun
markyun / gist:7689414
Created November 28, 2013 09:36
纯javascript验证邮箱格式
//邮箱验证纯javascript
function checkEmail(emailStr){
var start=0;
var end=emailStr.length;
while(start<end){//判断是否含有除"@"和"."之外的特殊字符和中文字符
var charcode=emailStr.charCodeAt(start);
if(!(charcode==45||charcode==46||
(charcode>=48&charcode<=59)||
(charcode>=64&charcode<=90)|| (charcode>=97&charcode<=122))){
@markyun
markyun / gist:7672975
Last active September 25, 2022 14:58
工作中常用的css样式
/*--------------------------------------------------------------
在CSS样式表中,合理有序的命名同样可以为整个CSS工作带来意想不到的简便。
为了更加符合搜索引擎的规范, 下面是一些常用的CSS代码命名标准。
页头: header (CSS中通常写为: #header)
登录条: loginBar
标志: logo
侧栏: sideBar
广告: banner
@markyun
markyun / gist:7670242
Last active December 29, 2015 12:28
原生js的写法Demo
//1———————原生js的写法———
// document.getElementsByClassName("btn")
// document.getElementById("btn")
// document.getElementsByTagName('div') 查找
//原生js在获取dom元素时,除了document.getElementById()外,其他的方式都会得到一个数组。然后用for循环遍历这个数组的时候,如果对数组里面的元素进行的操作是查找时候的条件或者是删除了这个dom元素,那么这个元素会从数组里面自动移除掉。
window.onload = function() {
document.getElementById("btn").onclick = function() {
Test();
}