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
| static void Main(string[] args) | |
| { | |
| var t = new Amazon.EC2.AmazonEC2Client("key", "scrt", Amazon.RegionEndpoint.USEast1); | |
| string nextToken = null; | |
| var lst = new List<Instance>(); | |
| do | |
| { | |
| var instances = t.DescribeInstances(new Amazon.EC2.Model.DescribeInstancesRequest() { NextToken = nextToken }); | |
| nextToken = instances.NextToken; | |
| lst.AddRange(instances.Reservations.SelectMany(a=>a.Instances).Where(a=>a.Tags.Any(b=>b.Key == "key" && b.Value == "value"))); |
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
| string input = "some input"; | |
| int output; | |
| if(int.TryParse(input, out output)) | |
| { | |
| //it parsed it | |
| // output now equals the value | |
| } | |
| else{ | |
| //it did not parse it |
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.Build.Evaluation.Project; | |
| using System.IO; | |
| void Main() | |
| { | |
| var files = Directory.GetFiles(@"c:\projects\projectRoot\", "*.csproj", SearchOption.AllDirectories); | |
| foreach (var file in files) | |
| { | |
| var project = new Project(file); | |
| project.SetProperty("LangVersion", "6"); | |
| project.Save(); |
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
| #region Apache License | |
| // | |
| // Licensed to the Apache Software Foundation (ASF) under one or more | |
| // contributor license agreements. See the NOTICE file distributed with | |
| // this work for additional information regarding copyright ownership. | |
| // The ASF licenses this file to you under the Apache License, Version 2.0 | |
| // (the "License"); you may not use this file except in compliance with | |
| // the License. You may obtain a copy of the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.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
| # Custom bash prompt via kirsle.net/wizards/ps1.html | |
| export PS1="\[$(tput bold)\]\$?|\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]" |
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
| const(\s?)(\w*)(\s?)=(\s)createSelector\( | |
| const$1$2$3=$4createMarkedSelector('$2', |
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 {createSelector} from 'reselect'; | |
| const hasPerformanceApi = | |
| window && | |
| window.performance && | |
| window.performance.measure && | |
| window.performance.mark; | |
| const createFuncWithMark = (name, callback) => (...args) => { | |
| const startMark = `${name}-Startmark`; |
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 class TargetLinkExtension : IMarkdownExtension | |
| { | |
| public void Setup(MarkdownPipelineBuilder pipeline) | |
| { | |
| } | |
| public void Setup(MarkdownPipeline pipeline, IMarkdownRenderer renderer) | |
| { | |
| var htmlRenderer = renderer as HtmlRenderer; |
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
| javaCount=`git diff --cached --name-status | grep -i .java | wc -l | awk '{print $1}'` | |
| if [ $javaCount -eq 0 ]; | |
| then | |
| exit 0 | |
| else | |
| exec ~/cargurus/cg-main/cargurus-build/local/devbox-push/run-checkstyle.sh | |
| fi |
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
| brew uninstall --ignore-dependencies node@10 | |
| brew uninstall --ignore-dependencies node | |
| brew uninstall --ignore-dependencies yarn | |
| brew uninstall --ignore-dependencies icu4c | |
| brew install node@10 | |
| brew install --ignore-dependencies yarn | |
| brew link --overwrite --force node@10 | |
| brew link --overwrite yarn |