Skip to content

Instantly share code, notes, and snippets.

@zymiboxpay
zymiboxpay / problem_case
Created October 11, 2016 10:18
fixed position problem
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>fixed problem</title>
<style>
.container {
position: relative;
}
@zymiboxpay
zymiboxpay / solution case
Created October 11, 2016 10:38
fixed position problem
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>absolute solution</title>
<style>
.container {
position: absolute;
display: flex;
@zymiboxpay
zymiboxpay / format_json.html
Last active November 7, 2016 03:30
将字符串整理成易读的 json 格式
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>format json</title>
<style>
textarea {
width: 100%;
min-height: 800px;
overflow-y: auto;
@zymiboxpay
zymiboxpay / index.html
Created November 10, 2016 04:23
css variables && animations
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css variables && animations</title>
<script src="http://cdn.bootcss.com/jquery/2.2.4/jquery.js"></script>
<style>
:root {
--transparency: 1;
--v_offset: -100%;
@zymiboxpay
zymiboxpay / README.md
Last active November 18, 2016 08:45
javascript 通讯录 索引 效果与微信类似

目标

  • 用javascript实现一个与微信通讯录效果相似的插件

要求

  • 易用
  • 尽量遵守 weui 设计规范
  • 最好是原生的,不依赖 jQuery
  • 页面滚动要流畅

分阶段目标

@zymiboxpay
zymiboxpay / 0_readme.md
Last active December 6, 2016 08:06
algorithm practises
@zymiboxpay
zymiboxpay / test.rb
Created December 12, 2016 11:19
random
#!/usr/bin/env ruby
#生成 10_000 个范围在0-4之间的随机数
#计算他们的平均值
#从中随机抽取100个数
#通过有放回重抽法尝试 10_000 次
#每次抽 100 个数
#计算这100个数的平均值
#计算这 10_000 次的平均值
#以上步骤尝试100次
module Solution
@zymiboxpay
zymiboxpay / particle_system.html
Last active December 29, 2016 06:45
particle_system
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>partical</title>
<style>
body {
margin: 0;
padding: 0;
}
@zymiboxpay
zymiboxpay / copy_to_clipboard.js
Created February 7, 2017 03:23
copy_to_clipboard
(function(global, undefined){
function copyToClipboard(content, successCallback) {
successCallback = successCallback || alert.bind(this, '复制成功');
// http://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript
// IE 8
if(window.clipboardData) {
window.clipboardData.setData('Text', content);
e.preventDefault();
}
// IE 9 以及现代浏览器
@zymiboxpay
zymiboxpay / star_grade.js
Created February 7, 2017 03:27
star_grade
/**
* 司机星级
*
* author: Jude.Zhu
* date: 2016-01-23
*
* require icomoon font-family
*
* usage:
*