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
<form class="myForm"> | |
<input type="input" id="name"> | |
</form> |
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
// 1. approach: | |
((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20}) | |
/* | |
( # Start of group | |
(?=.*\d) # must contains one digit from 0-9 | |
(?=.*[a-z]) # must contains one lowercase characters | |
(?=.*[A-Z]) # must contains one uppercase characters | |
(?=.*[@#$%]) # must contains one special symbols in the list "@#$%" |
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
//1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... | |
function fibonacci(n) { | |
var a = 1; | |
var b = 0; | |
var temp; | |
while (n >= 0) { | |
temp = a; | |
a = a + b; | |
b = temp; |
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 arrCollection() { | |
this.createArray = function(len) { | |
var ret = []; | |
for(var i = 0; i < len; i++) { | |
ret.push(i); | |
} | |
return ret; | |
}; | |
this.reduceToPrime = function(arr) { | |
var ret = arr.filter(function(value) { |
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
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> | |
<!DOCTYPE html> | |
<html ng-app="scormify" ng-strict-di> | |
<head> | |
<base href="/"> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
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
"use strict"; | |
;(function() { | |
angular | |
.module('xxx') | |
.controller('HomeCtrl', HomeCtrl); | |
HomeCtrl.$inject = ['$scope', '$http', '$state', '$location', '$stateParams', 'LocalStorage', 'QueryService', 'Account', 'Videos', 'toastr']; |
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
"use strict"; | |
(function() { | |
angular.module('weatherApp') | |
.factory('weatherSvc', LocationSvc); | |
WeatherSvc.$inject = ['$q', '$window', '$http', 'CONSTANTS']; | |
function WeatherSvc($q, $window, $http, CONSTANTS) { |
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
"use strict"; | |
const request = require('request'); | |
const fs = require('fs'); | |
const req = require('request-promise'); | |
const async = require('asyncawait/async'); | |
const await = require('asyncawait/await'); | |
const appConfig = require('../config.js'); | |
//hoist |
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
"use strict"; | |
//npm i express morgan body-parder method-override path cors moment request bluebird lodash --save | |
const express = require('express'); | |
const app = express(); | |
var server = require('http').createServer(app); | |
const morgan = require('morgan'); | |
const bodyParser = require('body-parser'); | |
const methodOverride = require('method-override'); |
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
"use strict"; | |
const appConfig = require('../config.js'); | |
const mongoose = require('mongoose'); | |
mongoose.connect(appConfig.MONGOLAB_URI); | |
mongoose.connection.on('error', (err) => { | |
console.log('Error: Could not connect to MongoDB. Did you forget to run `mongod`?'); | |
}); | |
mongoose.connection.once('open', (err) => { | |
console.log('Connected to MongoDb'); | |
}); |
OlderNewer