Skip to content

Instantly share code, notes, and snippets.

View AskYous's full-sized avatar
💭
React > Angular

Yousef Shanawany AskYous

💭
React > Angular
  • Bay Area, California
  • 15:37 (UTC +03:00)
  • X @askyous
View GitHub Profile
const rp = require('request-promise');
const url = 'https://en.wikipedia.org/wiki/List_of_Presidents_of_the_United_States';
rp(url)
.then(function(html){
//success!
console.log(html);
})
.catch(function(err){
//handle error
Build started 6/8/2017 3:08:00 PM.
Environment at start of build:
ALLUSERSPROFILE = C:\ProgramData
APPDATA = C:\Users\Yousef Shanawany\AppData\Roaming
CommonProgramFiles = C:\Program Files (x86)\Common Files
CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
CommonProgramW6432 = C:\Program Files\Common Files
COMPUTERNAME = AIR-540
ComSpec = C:\WINDOWS\system32\cmd.exe
DevEnvDir = C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\
/**
* Classes.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/documentation/concepts/models-and-orm/models
*/
module.exports = {
attributes: {
Error: request aborted
at IncomingMessage.onAborted (C:...\node_modules\body-parser\node_modules\raw-body\index.js:269:10)
at emitNone (events.js:67:13)
at IncomingMessage.emit (events.js:166:7)
at abortIncoming (_http_server.js:276:11)
at Socket.serverSocketCloseListener (_http_server.js:289:5)
at emitOne (events.js:82:20)
at Socket.emit (events.js:169:7)
at TCP._onclose (net.js:469:12)
{
'datetime': new Date()
}
@AskYous
AskYous / Results.md
Last active December 10, 2016 18:25
Use Case ID Browser Action Async: True POSTed? Async: False POSTed?
@AskYous
AskYous / showPHPErrors.php
Created November 26, 2015 14:22
Show PHP Errors
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
@AskYous
AskYous / isAndroidOrIPhone
Created July 8, 2015 20:10
Detect if User is on iPhone or Android
function detectBrowser() {
var useragent = navigator.userAgent;
var mapdiv = document.getElementById("map-canvas");
if (useragent.indexOf('iPhone') != -1 || useragent.indexOf('Android') != -1 ) {
console.log('You are on an Android or iPhone!');
} else {
}
}
@AskYous
AskYous / Start NodeJS Express App
Last active August 29, 2015 14:17
Run a NodeJS Express App
node app.js