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 System; | |
| using System.Linq; | |
| using System.Linq.Expressions; | |
| using System.Reflection; | |
| using System.Threading.Tasks; | |
| namespace ConsoleApp2 | |
| { | |
| class Program | |
| { |
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 static class ClientTypesGenerator | |
| + { | |
| + private static Dictionary<string,string> foundTypes = new Dictionary<string, string>(); | |
| + | |
| + public static void Generate() | |
| + { | |
| + var assemblies = AppDomain.CurrentDomain.GetAssemblies(); | |
| + | |
| + var controllerMethods = assemblies | |
| + .SelectMany(x => x.GetTypes()) |
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
| ## Pre-requisite: You have to know your last commit message from your deleted branch. | |
| git reflog | |
| # Search for message in the list | |
| # a901eda HEAD@{18}: commit: <last commit message> | |
| # Now you have two options, either checkout revision or HEAD | |
| git checkout a901eda | |
| # Or | |
| git checkout HEAD@{18} |
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
| 1) https://github.com/swagger-api/swagger-codegen | |
| generate models only DsupportingFiles need to import models.ts, it is improts all models, nice work with common types, use modle naming from json file | |
| ``` | |
| set output=C:\Temp\SwaggerTests\swaggerCli | |
| set swaggerCli=C:\Temp\SwaggerTests\swaggerCli\swagger-codegen-cli-2.2.1.jar | |
| set swaggerJson=http://localhost:5001/swagger/v1/swagger.json | |
| java -jar -Dmodels -DsupportingFiles=models.ts %swaggerCli% generate -l typescript-angular2 -i %swaggerJson% -o %output% | |
| @RD /S /Q %output%\api |
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 System; | |
| using System.Diagnostics; | |
| using System.Runtime.InteropServices; | |
| namespace CLRProfiling | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { |
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 System; | |
| using System.Runtime.InteropServices; | |
| namespace ConsoleApplication2 | |
| { | |
| [StructLayout(LayoutKind.Explicit)] | |
| internal struct Barbeque | |
| { | |
| [FieldOffset(0)] public int Barbe; | |
| [FieldOffset(0)] public bool Que; |
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 System; | |
| using System.Reflection; | |
| using System.Reflection.Emit; | |
| using System.Runtime.CompilerServices; | |
| namespace ConsoleApp2 | |
| { | |
| public static class MethodReplacer | |
| { | |
| public static unsafe void Replace(MethodInfo methodToReplace, MethodInfo methodToInject) |
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
| 1) Instagram | |
| Request | |
| GET https://api.instagram.com/v1/tags/nofilter/media/recent?access_token=ACCESS_TOKEN HTTP/1.1 | |
| User-Agent: Fiddler | |
| Host: api.instagram.com | |
| Response |
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 http://www.gitzip.com/ |
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 System; | |
| using System.Reflection; | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var allocate = typeof(RuntimeTypeHandle).GetMethod("Allocate", BindingFlags.NonPublic | BindingFlags.Static); | |
| var math = allocate.Invoke(null, new[] { typeof (Math) }); |
NewerOlder