This file contains hidden or 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
Add-Type -Path "$PSScriptRoot\Serilog.2.1.0\lib\net45\Serilog.dll" | |
Add-Type -Path "$PSScriptRoot\Serilog.Sinks.RollingFile.2.0.0\lib\net45\Serilog.Sinks.RollingFile.dll" | |
Add-Type -Path "$PSScriptRoot\Serilog.Sinks.Console.2.1.0\lib\net45\Serilog.Sinks.Console.dll" | |
Add-Type -Path "$PSScriptRoot\Serilog.Sinks.File.2.2.0\lib\net45\Serilog.Sinks.File.dll" | |
cls | |
$Config = New-Object Serilog.LoggerConfiguration | |
$logPath = "$PSScriptRoot\serilog.log" | |
$fileSize = 1073741824 |
This file contains hidden or 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 { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ | |
name: 'jsonDate' | |
}) | |
export class JsonDatePipe implements PipeTransform { | |
transform(value: any, args?: any): any { | |
if (value) { | |
return new Date(parseInt(value.substr(6))); |
This file contains hidden or 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
$originalpaths = (Get-ItemProperty -Path ‘Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment’ -Name PSModulePath).PSModulePath | |
# Add your new path to below after the ; | |
$newPath=$originalpaths+’;C:\PowerShell\Modules\’ | |
Set-ItemProperty -Path ‘Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment’ -Name PSModulePath –Value $newPath |
This file contains hidden or 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
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ | |
"key": "ctrl+d", | |
"command": "editor.action.copyLinesUpAction", | |
"when": "editorTextFocus" | |
} | |
] |
This file contains hidden or 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
// TODO | |
openDialog() { | |
const dialogRef = this.dialog.open(DialogResultExampleDialogComponent, { | |
width: '80%', | |
data: this.selected[0] // will show in config.data on the dialog | |
}); | |
dialogRef.afterClosed().subscribe(result => { | |
this.selectedOption = result; | |
}); | |
} |
This file contains hidden or 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
ALTER TABLE `talkbe_production`.`lists` | |
ADD COLUMN `promoted` TINYINT(1) NULL AFTER `temp`, | |
ADD COLUMN `order` INT(11) NULL AFTER `promoted`; |
This file contains hidden or 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
{ | |
"Print to console": { | |
"prefix": "log", | |
"body": [ | |
"console.log('$1');", | |
"$2" | |
], | |
"description": "Log output to console" | |
}, | |
"For Loop": { |
This file contains hidden or 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
npm install -g @angular/cli | |
npm install | |
ng build --environment=prod | |
mkdir deploy deploy/`git rev-parse HEAD` commits | |
cp dist/ deploy/`git rev-parse HEAD` -rf | |
git rev-parse HEAD > commits/`git rev-parse HEAD` |
This file contains hidden or 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 state = Observable.timer(1000) // every second | |
.map(() => this.loaded) | |
.repeat(8) // retry 8 times | |
.retry(); | |
state.subscribe((res) => { | |
// this is the main body of the retry | |
console.log('Result: ', res) // will out put false 8 times for the loaded value. | |
}, (err) => { }, () => { | |
if (this.loaded === false) { | |
this.errorLoading = true; // If it hasn't loaded in 8 secs it ain't gonna ;) |
This file contains hidden or 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
// Find the shortest word in an arra of words | |
// Example "Some so WOrds Will Be Longer" would return 2 | |
function findShort(s){ | |
return Math.min.apply(null, s.split(' ').map(w => w.length)); | |
} |