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
| public string deleteFiles = "data"; | |
| File.WriteAllText("outputs.json", JsonConvert.SerializeObject(new { deletedFile = deleteFiles })); |
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
| var path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); | |
| path = path.Substring(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
| Process p = new Process(); | |
| p.StartInfo.FileName = "cmd.exe"; <-- This will call your exe (replace your exe with cmd.exe) | |
| p.StartInfo.Arguments = "/c dir *.cs"; <-- You will be calling Static Main method of cmd.exe which may requier args[] | |
| So, pass them here with space separated form | |
| (Example: you need to send 3 args then pass like this: "arg1 arg2 arg3") | |
| p.StartInfo.UseShellExecute = false; | |
| p.StartInfo.RedirectStandardOutput = true; | |
| p.Start(); | |
| Console.WriteLine(p.StandardOutput.ReadToEnd()); <-- This line will get console data from cmd.exe project to your application console |
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 simple html, | |
| <div> | |
| <object type="text/html" data="http://validator.w3.org/" width="800px" height="600px" style="overflow:auto;border:5px ridge blue"> | |
| </object> | |
| </div> | |
| Or jquery, | |
| <script> | |
| $("#mydiv") |
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
| a.boxclose{ | |
| float:right; | |
| margin-top:-30px; | |
| margin-right:-30px; | |
| cursor:pointer; | |
| color: #fff; | |
| border: 1px solid #AEAEAE; | |
| border-radius: 30px; | |
| background: #605F61; | |
| font-size: 31px; |
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
| // User can be part of many groups | |
| const user = { | |
| groups: ["group2"] | |
| }; | |
| // Roles can have many groups | |
| // What you see here is the output or 2 different data source | |
| // Thats why we have group duplication inside different role | |
| const roles = [{ | |
| name: "role1", |
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
| <span id='close' onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode); return false;'>x</span> | |
| Css for close button | |
| #close { | |
| float:right; | |
| display:inline-block; | |
| padding:2px 5px; |
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
| private AccountController GetAccountController () | |
| { | |
| .. setup mocked services.. | |
| var accountController = new AccountController (..mocked services..); | |
| var controllerContext = new Mock<ControllerContext> (); | |
| controllerContext.SetupGet(p => p.HttpContext.Session["test"]).Returns("Hello World"); | |
| controllerContext.SetupGet(p => p.HttpContext.User.Identity.Name).Returns(_testEmail); | |
| controllerContext.SetupGet(p => p.HttpContext.Request.IsAuthenticated).Returns(true); |
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
| https://stackblitz.com/github/codecraft-tv/angular-course/tree/current/8.pipes/2.built-in-pipes/code |
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
| // Code source is from this awesome blog: | |
| // http://pfelix.wordpress.com/2012/11/27/json-web-tokens-and-the-new-jwtsecuritytokenhandler-class/ | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var securityKey = GetBytes("ThisIsAnImportantStringAndIHaveNoIdeaIfThisIsVerySecureOrNot!"); | |
| var tokenHandler = new JwtSecurityTokenHandler(); | |
NewerOlder