Skip to content

Instantly share code, notes, and snippets.

View codeofsumit's full-sized avatar
👨‍💻
Working on parqet.com

Sumit Kumar codeofsumit

👨‍💻
Working on parqet.com
View GitHub Profile
@codeofsumit
codeofsumit / build-n-learn.md
Last active December 19, 2015 10:28
Things to Build with Things to Learn

Things to Build

  • SlackBot to notify about Github PRs

Things to Learn

  • Heroku
  • Hubot
  • nodeJS
@codeofsumit
codeofsumit / .hyper.js
Created May 6, 2017 14:30
my current .hyper.js
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Meslo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
@codeofsumit
codeofsumit / levenshtein.js
Created July 1, 2017 16:39 — forked from andrei-m/levenshtein.js
Levenshtein distance between two given strings implemented in JavaScript and usable as a Node.js module
/*
Copyright (c) 2011 Andrei Mackenzie
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@codeofsumit
codeofsumit / index.html
Last active December 12, 2018 21:27
Geoman.io - Testing Maps with Cypress
<!DOCTYPE >
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@latest/dist/leaflet.css" />
<link rel="stylesheet" href="dist/leaflet.pm.css" />
<script src="https://unpkg.com/leaflet@latest/dist/leaflet.js"></script>
<style>
html,
@codeofsumit
codeofsumit / index.js
Last active December 12, 2018 21:33
index.js inside cypress/support
import './commands';
beforeEach(() => {
// create the map
cy.visit('/index.html', {
onLoad: (contentWindow) => {
const { L } = contentWindow;
// OSM tiles
const tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
Cypress.Commands.add('toolbarButton', name => cy.get(`.leaflet-pm-icon-${name}`));
describe('Draw & Edit Polygons', () => {
it('correctly draws a polygon', () => {
cy.toolbarButton('polygon')
.closest('.button-container')
.should('have.not.class', 'active');
cy.toolbarButton('polygon')
.click()
.closest('.button-container')
Cypress.Commands.add('hasMiddleMarkers', (count) => {
cy.get('.marker-icon-middle').should(($p) => {
expect($p).to.have.length(count);
});
});
Cypress.Commands.add('hasVertexMarkers', (count) => {
cy.get('.marker-icon:not(.marker-icon-middle)').should(($p) => {
expect($p).to.have.length(count);
});
describe('Draw & Edit Polygons', () => {
it('correctly draws a polygon', () => {
cy.toolbarButton('polygon')
.closest('.button-container')
.should('have.not.class', 'active');
cy.toolbarButton('polygon')
.click()
.closest('.button-container')
describe('Draw & Edit Polygons', () => {
it('correctly draws a polygon', () => {
cy.toolbarButton('polygon')
.closest('.button-container')
.should('have.not.class', 'active');
cy.toolbarButton('polygon')
.click()
.closest('.button-container')