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
$date = Get-Date -UFormat %Y-%m-%d; | |
$backupFolder = $date; | |
$basePath = 'C:\projects\db-backups'; | |
$destinationPath = Join-Path $basePath $backupFolder; | |
$mongodumpPath = 'C:\Program Files\MongoDB\Server\3.4\bin\mongodump.exe'; | |
Write-Host " | |
Your backup parameters are: |
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
SELECT command, | |
s.text, | |
start_time, | |
percent_complete, | |
CAST(((DATEDIFF(s,start_time,GetDate()))/3600) as varchar) + ' hour(s), ' | |
+ CAST((DATEDIFF(s,start_time,GetDate())%3600)/60 as varchar) + 'min, ' | |
+ CAST((DATEDIFF(s,start_time,GetDate())%60) as varchar) + ' sec' as running_time, | |
CAST((estimated_completion_time/3600000) as varchar) + ' hour(s), ' | |
+ CAST((estimated_completion_time %3600000)/60000 as varchar) + 'min, ' | |
+ CAST((estimated_completion_time %60000)/1000 as varchar) + ' sec' as est_time_to_go, |
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
var f1 = () => { | |
return new Promise((resolve, reject) =>{ | |
setTimeout(()=>{ | |
resolve('p1 complete'); | |
}, 1000); | |
}); | |
}; | |
var f2 = () => { | |
return new Promise((resolve, reject) =>{ |
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 React, { Component } from 'react' | |
import { MyInput, MyAnotherInput } from 'myInputs' | |
class MyComponent extends Component { | |
handleChange = (e) => e.preventDefault() | |
handleClick = (e) => e.preventDefault() | |
handleKeyPress = (e) => { | |
e.preventDefault() |
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
let isFunction = function(obj) { | |
return typeof obj == 'function' || false; | |
}; | |
class EventEmitter { | |
constructor() { | |
this.listeners = new Map(); | |
} | |
addListener(label, callback) { | |
this.listeners.has(label) || this.listeners.set(label, []); |
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
var cluster = require('cluster'); | |
if (cluster.isMaster) { | |
var cpuCount = 4; //require('os').cpus().length; | |
for (var i = 0; i < cpuCount; i += 1) { | |
cluster.fork(); | |
} | |
cluster.on('online', function (worker) { | |
console.log('Worker ' + worker.process.pid + ' is online.'); |
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
/** | |
* An async module | |
* @module asyncModule | |
*/ | |
var q = require('q'); | |
var debug = require('debug')('asyncModule'); | |
debug.log = console.log.bind(console); | |
var service = (function () { | |
//private |
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
var $d = (function () { | |
function $d() { | |
var self = this; | |
this._success = []; | |
this._fail = []; | |
this.promise = { | |
then: function (callback) { | |
self._success.push(callback); | |
}, |
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
public class SessionManager | |
{ | |
#region Instance | |
private SessionManager() { } | |
private const string SESSIONKEY = "SessionManager"; | |
public static SessionManager Current | |
{ | |
get | |
{ | |
SessionManager instance = (SessionManager)HttpContext.Current.Session[SESSIONKEY]; |
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
/* | |
************ Noul If ************ | |
ofera multiple avantaje vs nativul if. | |
1. EstePascalCase | |
2. Are(callbackuri) la fel ca d3. Genial! | |
3. Accepta multiple Then/Else pentru a se mula pe orice proiect. | |
4. Colegii il vor adopta imediat ! | |
Flexibil! Dinamic! Util! Deloc Ironic! |
NewerOlder