Skip to content

Instantly share code, notes, and snippets.

View ifyour's full-sized avatar
🏁
问题解决师

明明 ifyour

🏁
问题解决师
View GitHub Profile
@ifyour
ifyour / placeholder.js
Created August 9, 2017 06:46
低版本 IE 模拟实现 placeholder
;(function(factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// CommonJS
factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
@ifyour
ifyour / vertical.scss
Last active December 6, 2017 05:58
移动端屏幕适配方案: vertical.scss, 优先使用 CSS3 中的 vw, 如果不支持, 就降级处理使用媒体查询.
// 使用媒体查询动态设置 html font-size 根字体的大小
// 然后统一使用 rem 设置宽高等
// 使用 iPhone 6 作为参考, 基准字体大小 20px
$baseWidth: 375px;
$baseFont: 20px;
html {
font-size: $baseFont;
outline: 0;
font-family: sans-serif; // 1
@ifyour
ifyour / not-copy.html
Last active August 24, 2017 01:52
js 实现禁止文本复制、禁止选中文本 // Demo: http://jsbin.com/bijoreh
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>js实现禁止文本复制、禁止选中文本</title>
</head>
<body>
<p>这是一段普通的文本文字,你可以选中并且复制。</p>
@ifyour
ifyour / fuzzy-search.html
Last active August 24, 2017 06:49
模糊查询的2种实现方式 // Demo: http://jsbin.com/gabijen
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
* {
list-style: none;
@ifyour
ifyour / extensions.json
Last active May 10, 2020 03:55
VSCode's Settings - Syncing
[
{
"id": "alefragnani.Bookmarks",
"name": "Bookmarks",
"publisher": "alefragnani",
"version": "11.2.0"
},
{
"id": "azemoh.one-monokai",
"name": "one-monokai",
@ifyour
ifyour / head.html
Created September 2, 2017 02:26
网页中 head 的用法
<!DOCTYPE html>
<!-- 使用 HTML5 doctype,不区分大小写 -->
<html lang="zh-cmn-Hans">
<!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa -->
<head>
<!-- 声明文档使用的字符编码 -->
<meta charset='utf-8'>
<!-- 优先使用 IE 最新版本和 Chrome -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
@ifyour
ifyour / gulpfile.js
Last active December 11, 2017 16:48
My gulp work flow!
var gulp = require('gulp'),
htmlFile = './src/**/*.html',
cssFile = './src/**/*.css',
sassFile = './src/sass/*.scss',
jsFile = './src/**/*.js',
imgFile = './src/img/*.*',
distDir = './dist/';
// deving run `gulp dev`
@ifyour
ifyour / coinhive-demo.html
Last active February 2, 2018 07:14
挖矿脚本, 此脚本将占用系统 CPU 80%
<html>
<head>
<title>coinhive-demo</title>
</head>
<body>
<script src="https://coinhive.com/lib/coinhive.min.js"></script>
<script>
(function() {
@ifyour
ifyour / cmder.config.xml
Last active July 14, 2018 00:54
Cmder 个人配置备份
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2018-04-11 16:13:40" build="161022">
<value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{cmd::Cmder as Admin}"/>
<value name="StartFarFolders" type="hex" data="00"/>
<value name="StartFarEditors" type="hex" data="00"/>
@ifyour
ifyour / cookie.js
Last active January 31, 2018 09:16
ES6 封装操作 Cookie : get/set/has/remove/clear , 推荐使用第三方库: https://github.com/js-cookie/js-cookie