Skip to content

Instantly share code, notes, and snippets.

@sivagao
sivagao / readme.md
Created Jan 28, 2019
JavaScript Testing Overview with pingcap adaptor
View readme.md

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.
View rxjs_operators_by_example.md
@sivagao
sivagao / cloudSettings
Created May 22, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-05-22T08:54:45.280Z","extensionVersion":"v2.9.2"}
View top10k_chromeexts
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
View 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 Apr 30, 2014
A Pen by siva Gao.
View index.jade
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.
View 避免重复查询requery
<!doctype html>
<html lang="en">
<head>
<title>JavaScript 模式和反模式</title>
<meta charset="utf-8">
</head>
<body>
<script>
/* 题目: 重复查询
* 描述: 使用jQuery的链接,可以避免重复查询
View 窗口滚动事件
<!doctype html>
<html lang="en">
<head>
<title>JavaScript 模式和反模式</title>
<meta charset="utf-8">
</head>
<body>
<script>
/* 题目: 窗口滚动事件
* 描述: 不要在窗口滚动事件上附加事件处理程序
@sivagao
sivagao / scrollfixnavbar.js
Created Jan 11, 2014
scroll to fix navbar
View scrollfixnavbar.js
$(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');
}
You can’t perform that action at this time.