1. ES6 .includes()
:
var S = "fullweb";
S.includes("web");
2. RegExp .search()
:
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
var express = require('express'); | |
var mongoose = require('mongoose'); | |
var userInfo = require('../models/userInfo'); | |
var router = express.Router(); | |
router.post('/',function(req,res){ | |
userInfo.find({'companyId': req.body.companyId, verified : req.body.verified },function(err,data){ | |
if(data){ |
angular.module('pit', ['ionic', 'ngCordova']) | |
.run(function($ionicPlatform, $cordovaGeolocation) { | |
$ionicPlatform.ready(function() { | |
if(window.cordova && window.cordova.plugins.Keyboard) { | |
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard | |
// for form inputs) | |
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); | |
// Don't remove this line unless you know what you are doing. It stops the viewport |
<html><body> | |
<script type="text/javascript"> | |
// Used to scale image according to aspect ratio | |
function calculateAspectRatioFit(srcWidth, srcHeight, maxWidth, maxHeight) { | |
var ratio = Math.min(maxWidth / srcWidth, maxHeight / srcHeight); | |
return { width: srcWidth*ratio, height: srcHeight*ratio }; | |
} | |
// Calculate aspect ratio |
{ | |
"AP":[ | |
"Adilabad", | |
"Anantapur", | |
"Chittoor", | |
"Kakinada", | |
"Guntur", | |
"Hyderabad", | |
"Karimnagar", | |
"Khammam", |
{ | |
"AP":"Andhra Pradesh", | |
"AR":"Arunachal Pradesh", | |
"AS":"Assam", | |
"BR":"Bihar", | |
"CG":"Chhattisgarh", | |
"Chandigarh":"Chandigarh", | |
"DN":"Dadra and Nagar Haveli", | |
"DD":"Daman and Diu", | |
"DL":"Delhi", |
var net = require('net'); | |
var sockets = []; | |
var port = 8000; | |
var guestId = 0; | |
var server = net.createServer(function(socket) { | |
// Increment | |
guestId++; | |
socket.nickname = "Guest" + guestId; |
#! /usr/bin/env python | |
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++| | |
# Python P2P Chat Server | | |
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++| | |
# First we are importing some libraries which we use in our program | |
# You can read about each library at https://docs.python.org/3.0/library/index.html | |
import socket | |
import sys |
'click .preview-image-delete': function() { | |
document.getElementById("fname").addEventListener("focus", myFunction); | |
function myFunction() { | |
document.getElementById("fname").style.backgroundColor = "red"; | |
} | |
} |