A Pen by Marvin Trilles on CodePen.
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
using Microsoft.AspNetCore.Cors; //add reference to the needed library | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
// Add framework services. | |
services.AddMvc(); | |
//Add CORS service beloe | |
services.AddCors( options => options.AddPolicy("AllowCors", | |
builder => { |
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 this on the head tag --> | |
<script src="https://apis.google.com/js/platform.js" async defer></script> |
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
//use curly brace to group assignment statements | |
_localDb.Where( i => i.id == id).ToList().ForEach( i => { | |
i.name = task.name; | |
i.completed = task.completed; | |
i.priority = task.priority; | |
}); |
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
<form [formGroup]="detail_form" (ngSubmit)="onSubmit()"> | |
<fieldset> | |
<div class="row form-group"> | |
<input class="form-control" id="title" placeholder="Enter Title" formControlName = "title" required> | |
<small *ngIf="detail_form.controls.title.invalid && detail_form.controls.title.touched" class="error">Title is empty.</small> | |
</div> | |
<div class="row form-group"> | |
<textarea class="form-control" rows="10" id="poem" formControlName ="poem" required></textarea> | |
<small *ngIf="detail_form.controls.poem.invalid && detail_form.controls.poem.touched" class="error">Poem is empty.</small> | |
</div> |
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
$version = &"java.exe" -version 2>&1 | |
$version = $version[0].tostring() | |
$start = $version.IndexOf('"') | |
$version = $version.Remove(0,$start-1).Replace('"','').Trim() | |
$required = "1.8.0_114" | |
$result = $version.CompareTo($required) | |
if($result -eq 0) { |
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
# types : vw-views, sp-stored procs, fn - function, tg - triggerparam($serverName, $fileName, $type, $location)[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | out-null $dbName = "GlobalSTORE"$srv = new-object Microsoft.SqlServer.Management.Smo.Server($serverName) $db = $srv.Databases.Item($dbName) $folderLocation = $location$type = $type.ToString().ToUpper() | |
function Alert { | |
param($m1,$m2,$m3,$m4,$m5) | |
Write-Host $m1 $m2 $m3 $m4 $m5 | |
} | |
function GetBackupLocation { | |
if ($type -eq "VW") { | |
$folderLocation = $location + "\Views\"; | |
} elseif ($type -eq "SP") { | |
$folderLocation = $location + "\StoredProcedures\"; |
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
@echo off | |
ECHO ********************************************************** | |
ECHO NOTE : | |
ECHO Code Analysis is enabled by default and for a good reason | |
ECHO Use this script at your own risk | |
ECHO ********************************************************** | |
ECHO . | |
ECHO Starting Visual Studio 2013 with Code Analysis OFF | |
set DevDivCodeAnalysisRunType=Disabled | |
devenv |
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
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
import os | |
import csv | |
import sys | |
import time | |
import socket | |
import datetime |
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
Imports System.IO | |
Imports System.Collections.Generic | |
Imports System.Xml | |
Module Module1 | |
Sub Main() | |
' Read the sample file and populate list | |
Dim taxes As List(Of Tax) = GetData("xDataSample.txt") |
OlderNewer