Skip to content

Instantly share code, notes, and snippets.

View efekarakus's full-sized avatar
📚

Efe Karakus efekarakus

📚
View GitHub Profile
@efekarakus
efekarakus / bar.js
Last active October 15, 2015 04:23
Simple Bar Chart
var bar = function() {
var margin = {top: 0, right: 0, bottom: 0, left: 0},
width = 500,
height = 200;
function chart(selection) {
selection.each(function(data) {
var svg = d3.select(this).append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
@efekarakus
efekarakus / index.html
Last active October 15, 2015 04:24
Binary Step Plot
<html>
<head>
<meta charset="utf-8">
<title>Step Graph</title>
<style>
path.steps {
stroke: #000;
stroke-width: 3;
fill: none;
}
@efekarakus
efekarakus / d3-peaks.js
Last active March 4, 2016 18:20
Ricker Wavelet
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.d3_peaks = global.d3_peaks || {})));
}(this, function (exports) { 'use strict';
/**
* See https://en.wikipedia.org/wiki/Mexican_hat_wavelet
*/
function ricker() {
@efekarakus
efekarakus / d3-peaks.js
Last active March 5, 2016 03:00
Convolution
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.d3_peaks = global.d3_peaks || {})));
}(this, function (exports) { 'use strict';
/**
* See https://en.wikipedia.org/wiki/Mexican_hat_wavelet
*/
function ricker() {
@efekarakus
efekarakus / README.md
Last active March 15, 2016 16:09
Find Peaks

This example illustrates how to use the findPeaks API. You can download the library from https://github.com/efekarakus/d3-peaks.

The algorithm is based on "Improved peak detection in mass spectrum by incorporating continuous wavelet transform-based pattern matching" by Pan Du, Warren A. Kibbe and Simon M. Lin. The paper can be found here.

@efekarakus
efekarakus / index.html
Last active March 1, 2017 06:14
Venn Diagram with d3js
<!DOCTYPE html>
<meta charset="utf-8">
<style>
g.A circle {
fill: brown;
fill-opacity: .5;
stroke: black;
}
g.B circle {
@efekarakus
efekarakus / multiple-params-vs-closure-1.js
Created June 1, 2017 02:31
Multiple Parameters vs. Closure 1
function recordMetricOnCompletion(metricName, promise) {
const metric = Metric.newTimedMetric(metricName);
return promise
.then(values => {
metric.emitSuccess();
return Promise.resolve(values);
})
.catch(reason => {
metric.emitFailure();
@efekarakus
efekarakus / multiple-params-vs-closure-2.js
Created June 1, 2017 02:32
Multiple Parameters vs. Closure 2
function getRecordedPromise(metricName) {
const metric = Metric.newTimedMetric(metricName);
return (promise) => {
return promise
.then(values => {
metric.emitSuccess();
return Promise.resolve(values);
})
.catch(reason => {
@efekarakus
efekarakus / before.js
Last active June 1, 2017 05:33
closure-over-multiple-parameters
// Before
function recordMetricOnCompletion(metricName, promise) {
const metric = Metric.newTimedMetric(metricName);
return promise
.then(values => {
metric.emitSuccess();
return Promise.resolve(values);
})
.catch(reason => {
@efekarakus
efekarakus / gist:db0faa4bd48b6acb395280b8f3c23016
Created April 26, 2019 17:05
sample-integ-test-run-coverage
[Container] 2019/04/26 16:56:32 Running command make integ-test
Installing dependencies...
go get github.com/wadey/gocovmerge
Building ecs-cli.test...
env -i PATH=$PATH GOPATH=$GOPATH GOROOT=$GOROOT GOCACHE=$GOCACHE \
go test -coverpkg ./ecs-cli/modules/... -c -tags testrunmain -o ./bin/local/ecs-cli.test ./ecs-cli
Running integration tests...
go test -tags integ ./ecs-cli/integ/e2e/...
ok github.com/aws/amazon-ecs-cli/ecs-cli/integ/e2e 350.161s
# Our integration tests generate a separate coverage file for each CLI command.