This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var call = Function.prototype.call; | |
Function.prototype.call = function() { | |
console.log(this, arguments); | |
return call.apply(this, arguments); | |
}; | |
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// you will also have to setup the referring domains on your marvel developer portal | |
var PRIV_KEY = "this-should-be-a-long-hash"; | |
var PUBLIC_KEY = "so-should-this"; | |
function getMarvelResponse() { | |
// you need a new ts every request | |
var ts = new Date().getTime(); | |
var hash = CryptoJS.MD5(ts + PRIV_KEY + PUBLIC_KEY).toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios') | |
/* ... */ | |
const params = new URLSearchParams() | |
params.append('name', 'Akexorcist') | |
params.append('age', '28') | |
params.append('position', 'Android Developer') | |
params.append('description', 'birthdate=25-12-1989&favourite=coding%20coding%20and%20coding&company=Nextzy%20Technologies&website=http://www.akexorcist.com/') | |
params.append('awesome', true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { graphql, GraphQLString, GraphQLInt } from 'graphql'; | |
import { objectType, enumType, schemaFrom, listOf } from 'graphql-schema'; | |
import request from 'promisingagent'; | |
const repositorySortEnum = enumType('RepositorySort') | |
.value('CREATED', 'created') | |
.value('UPDATED', 'updated') | |
.value('PUSHED', 'pushed') | |
.value('FULL_NAME', 'full_name') | |
.end(); |
###Prerequesites
- Install node.js from http://nodejs.org
- Make sure you install git from http://git-scm.com
Install flightplan globally
npm install -g flightplan
Install flightplan in your project folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
import cherrio from 'cheerio'; | |
async function getHTML(productURL) { | |
const { data: html } = await axios.get(productURL, { | |
headers: { | |
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36' | |
} | |
}) | |
.catch(function (error) { |
-
Search text through all files at once
- Mac:
Command + Shift + f
- Windows:
Ctrl + Shift + f
- Mac:
-
Re-open a closed editor When you have multiple open files and accidentally close one or more of them, finding them, and re-opening can be time-consuming and a little frustrating. This is an undo feature exclusively for tabs:
-
Mac:
Command + Shift + t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//JS QuickSort | |
Array.prototype.quickSort = function() { | |
var r = this; | |
if(this.length <= 1) { | |
return this; | |
} | |
var less = [], greater = []; |