Skip to content

Instantly share code, notes, and snippets.

@sivagao
sivagao / readme.md
Created January 28, 2019 02:23
JavaScript Testing Overview with pingcap adaptor

An Overview of JavaScript Testing

通常来说,JS 开发者不习惯网站开发测试,JS 测试一般会很局限,难以实施,运行慢和写起来费时。

Test Types

测试类型可以分为很多种,具体可以参考[reference]。但最主要有如下三种:

  • 单元测试 Unit Tests- Testing of individual functions or classes by supplying input and making sure the output is as expected.
  • 集成测试 Integration Tests- Testing processes or components to behave as expected, including the side effects.
@sivagao
sivagao / rxjs_operators_by_example.md
Created January 23, 2019 10:13 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example
@sivagao
sivagao / cloudSettings
Created May 22, 2018 08:54
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-05-22T08:54:45.280Z","extensionVersion":"v2.9.2"}
cfhdojbkjhnklbpkdaibdccddilifddb Adblock Plus 10000000
gighmmpiobklfepjocnamgkkbiglidom AdBlock 10000000
efaidnbmnnnibpcajpcglclefindmkaj Adobe Acrobat 10000000
gomekmidlodglbbmalcneegieacbdmki Avast Online Security 10000000
eofcbnmajmjmplflapaojjnihcjkigck Avast SafePrice 10000000
chfdnecihphmhljaaejmgoiahnihplgn AVG Web TuneUp 10000000
flliilndjeohchalpbbcdekjklbdgfkk Avira Browser Safety 10000000
gpdjojdkbbmdfjfahjcgigfpmkopogic Pin It Button 10000000
lifbcibllhkdhoafpjfnlhfpfgnpldfl Skype 10000000
mallpejgeafdahhflmliiahjdpgbegpk FromDocToPDF 9298905
@sivagao
sivagao / index.html
Last active August 29, 2015 14:04 — forked from minikomi/index.html
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v2.min.js?2.10.0"></script>
<script>
var width = 960,
height = 700;
var svg = d3.select("body").append("svg")
@sivagao
sivagao / index.jade
Created April 30, 2014 03:43
A Pen by siva Gao.
div#da-slider.da-slider
each item in [1,2,3,4]
div.da-slide
h2 Warm Welcome
p When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane.
a.da-link Read More
.da-img
img(src='http://tympanus.net/Development/ParallaxContentSlider/images/1.png')
header.
<!doctype html>
<html lang="en">
<head>
<title>JavaScript 模式和反模式</title>
<meta charset="utf-8">
</head>
<body>
<script>
/* 题目: 重复查询
* 描述: 使用jQuery的链接,可以避免重复查询
<!doctype html>
<html lang="en">
<head>
<title>JavaScript 模式和反模式</title>
<meta charset="utf-8">
</head>
<body>
<script>
/* 题目: 窗口滚动事件
* 描述: 不要在窗口滚动事件上附加事件处理程序
@sivagao
sivagao / scrollfixnavbar.js
Created January 11, 2014 16:33
scroll to fix navbar
$(document).ready(function() {
var navpos = $('#mainnav').offset();
console.log(navpos.top);
$(window).bind('scroll', function() {
if ($(window).scrollTop() > navpos.top) {
$('#mainnav').addClass('fixed');
}
else {
$('#mainnav').removeClass('fixed');
}