Skip to content

Instantly share code, notes, and snippets.

View kuldeepdaftary's full-sized avatar
🎯
Focusing

Kuldeep Daftary kuldeepdaftary

🎯
Focusing
  • London
View GitHub Profile
@msmfsd
msmfsd / es7-async-await.js
Last active February 4, 2024 17:38
Javascript fetch JSON with ES7 Async Await
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch
// async function
async function fetchAsync () {
// await response of fetch call
let response = await fetch('https://api.github.com');
// only proceed once promise is resolved
let data = await response.json();
// only proceed once second promise is resolved
@staltz
staltz / introrx.md
Last active April 19, 2024 18:49
The introduction to Reactive Programming you've been missing
@squidge
squidge / Gruntfile.js
Created April 4, 2014 21:15
Grunt-Protractor-task
module.exports = function(grunt) {
grunt.initConfig({
protractor_webdriver: {
local: {
options: {
path: '',
command: 'webdriver-manager start',
},
},
@paulirish
paulirish / gist:4158604
Created November 28, 2012 02:08
Learn JavaScript concepts with recent DevTools features

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:

@huangzhichong
huangzhichong / selenium-webdriver-cheatsheet.md
Created August 7, 2012 12:38
Selenium Webdriver CheatSheet

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
  • Go to a specified URL
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"