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 { mergeKeepShape } from "./mergeKeepShape"; | |
| import Immutable from "seamless-immutable"; // Not required, just ensures test does not mutate inputs | |
| describe("mergeShape", function () { | |
| it("should extend only existing properties", () => { | |
| let newObject = mergeKeepShape( | |
| Immutable({ | |
| a : 5, | |
| // b is not here | |
| c : 33, |
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": "0.1.0", | |
| "command": "npm", | |
| "isShellCommand": true, | |
| "args": ["run"], | |
| "tasks": [ | |
| { | |
| "taskName": "start", | |
| "args": [], | |
| "isBuildCommand": 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
| set filepath="C:\some path\having spaces.txt" | |
| for /F "delims=" %%i in (%filepath%) do set dirname="%%~dpi" | |
| for /F "delims=" %%i in (%filepath%) do set filename="%%~nxi" | |
| for /F "delims=" %%i in (%filepath%) do set basename="%%~ni" | |
| echo %dirname% | |
| echo %filename% | |
| echo %basename% |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <configuration> | |
| <packageSources> | |
| <clear /> | |
| <add key="AspNetCI" value="https://www.myget.org/F/aspnetcirelease/api/v3/index.json" /> | |
| <add key="NuGet.org" value="https://api.nuget.org/v3/index.json" /> | |
| </packageSources> | |
| </configuration> |
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 Microsoft.AspNetCore.Mvc.Filters; | |
| namespace Example | |
| { | |
| public class ApiExceptionFilter : Attribute, IExceptionFilter | |
| { | |
| public void OnException(ExceptionContext context) | |
| { | |
| if (context.Exception is Exception) { |
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 Microsoft.AspNetCore.Mvc; | |
| using Microsoft.AspNetCore.Mvc.Filters; | |
| namespace Example | |
| { | |
| public class ModelStateValidationFilter : Attribute, IActionFilter | |
| { | |
| public void OnActionExecuting(ActionExecutingContext context) | |
| { |
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 Microsoft.AspNetCore.Mvc; | |
| using Microsoft.AspNetCore.Mvc.Filters; | |
| namespace Example | |
| { | |
| public class NullValidationFilter : Attribute, IActionFilter | |
| { | |
| public void OnActionExecuting(ActionExecutingContext context) | |
| { |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <configuration> | |
| <packageSources> | |
| <!--To inherit the global NuGet package sources remove the <clear/> line below --> | |
| <clear /> | |
| <add key="aspnetcirelease" value="https://www.myget.org/F/aspnetcirelease/api/v3/index.json" /> | |
| <add key="dotnet-core" value="https://www.myget.org/F/dotnet-core/api/v3/index.json" /> | |
| <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" /> | |
| </packageSources> | |
| </configuration> |
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.Threading.Tasks; | |
| using AspNetApiMonolithSample.Models; | |
| using Microsoft.AspNetCore.Identity; | |
| using Microsoft.AspNetCore.Mvc.ModelBinding; | |
| namespace AspNetApiMonolithSample.Mvc | |
| { | |
| /// <summary> | |
| /// Request user modelbinder from UserManager automatically |
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
| #!/bin/bash | |
| instagram_user_id=25025320 | |
| count=12 | |
| csrftoken=$(curl --head -k https://www.instagram.com/ 2>&1 | grep -Po "^Set-Cookie: csrftoken=\K(.*?)(?=;)") | |
| curl "https://www.instagram.com/query/" -H "cookie: csrftoken=$csrftoken;" -H "x-csrftoken: $csrftoken" -H "referer: https://www.instagram.com/" --data "q=ig_user($instagram_user_id)%20%7B%20media.after(0%2C%20$count)%20%7B%0A%20%20count%2C%0A%20%20nodes%20%7B%0A%20%20%20%20caption%2C%0A%20%20%20%20code%2C%0A%20%20%20%20comments%20%7B%0A%20%20%20%20%20%20count%0A%20%20%20%20%7D%2C%0A%20%20%20%20date%2C%0A%20%20%20%20dimensions%20%7B%0A%20%20%20%20%20%20height%2C%0A%20%20%20%20%20%20width%0A%20%20%20%20%7D%2C%0A%20%20%20%20display_src%2C%0A%20%20%20%20id%2C%0A%20%20%20%20is_video%2C%0A%20%20%20%20likes%20%7B%0A%20%20%20%20%20%20count%0A%20%20%20%20%7D%2C%0A%20%20%20%20owner%20%7B%0A%20%20%20%20%20%20id%2C%0A%20%20%20%20%20%20username%2C%0A%20%20%20%20%20%20full_name%2C%0A%20%20%20%20%20%20profile_pic_url%0A%20%20%20%20%7D%2C%0A%20%20%20%20thumbnail_src%2C% |