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
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="AngularJS Routes" stopProcessing="true"> | |
<match url=".*" /> | |
<conditions logicalGrouping="MatchAll"> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> | |
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> | |
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" /> | |
</conditions> |
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
On the server locate folder | |
a. C:\Windows\Microsoft.NET\Framework64\v4.0.30319 | |
b. Check "aspnet_regiis.exe" exists | |
Run cmd | |
a. cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319 | |
To Encrypt: | |
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis –pef "connectionStrings" "path" | |
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis –pef "appSettings" "path" |
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 void Convert(string Base64String) | |
{ | |
string fileName = "test.jpg"; | |
string rootpath = Server.MapPath(Path.Combine("~", "Image", fileName)); | |
ConvertBase64ToFile.ConvertToFile(rootpath, Base64String.Split(',')[1]); | |
} | |
public class ConvertBase64ToFile | |
{ | |
public static void ConvertToFile(string location, string file) |
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
// Add to Global.asax.cs | |
protected void Application_BeginRequest() | |
{ | |
if (Request.Headers.AllKeys.Contains("Origin") && Request.HttpMethod == "OPTIONS") | |
{ | |
Response.Flush(); | |
} | |
} |
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
/* Add data-title to the <td> element like this <td data-title="column header here"></td> */ | |
media only screen and (max-width: 900px) { | |
/* Force table to not be like tables anymore */ | |
#no-more-tables table, | |
#no-more-tables thead, | |
#no-more-tables tbody, | |
#no-more-tables th, | |
#no-more-tables td, |
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
/* | |
npm install serve-static | |
npm install connect | |
http://localhost:5000/ | |
*/ | |
var connect = require("connect"), serveStatic = require("serve-static"); | |
var server = connect(); | |
server.use(serveStatic(".")); |
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
// This will download the file from the server | |
// Pass in the filepath of where file is stored and a new file name | |
private static void GetFileFromServer(string currentFilePath, string newFileName) | |
{ | |
HttpResponse httpresponse = HttpContext.Current.Response; | |
httpresponse.Clear(); | |
httpresponse.Charset = "utf-8"; | |
httpresponse.ContentType = "application/pdf"; // mime type to suit file type | |
httpresponse.AddHeader("content-disposition", string.Format("attachment; filename={0}", newFileName)); | |
httpresponse.BinaryWrite(File.ReadAllBytes(currentFilePath)); |
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
using Ionic.Zip; | |
[HttpPost] | |
public void ZipFiles(FormCollection collection) | |
{ | |
using (ZipFile zip = new ZipFile()) | |
{ | |
zip.AlternateEncodingUsage = ZipOption.AsNecessary; | |
var file_collection = _repository.GetListOfFiles(); |
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 string ComplyWithCSV(string sentense) | |
{ | |
if(!string.IsNullOrEmpty(sentense)) | |
{ | |
var stripped = sentense.Replace("\"", "\"\""); // Replaces a " with "" | |
sentense = "\"" + stripped + "\""; // Add " to start and end to allow , | |
} | |
return sentense; | |
} |
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
<system.net> | |
<mailSettings> | |
<smtp deliveryMethod="Network"> | |
<network host="smtp.sendgrid.net" port="587" defaultCredentials="false" userName="azure_{{guid}}@azure.com" password="*********" /> | |
</smtp> | |
</mailSettings> | |
</system.net> |
OlderNewer