Skip to content

Instantly share code, notes, and snippets.

View shonnly's full-sized avatar

Shonn Lyga shonnly

View GitHub Profile
//For a full explanation on this code, checkout Mike Van Sickle' Go course on pluralsight
package main
import (
"encoding/xml"
"fmt"
"io/ioutil"
"net/http"
)
using Newtonsoft.Json;
using System;
using System.Net;
using System.Xml;
namespace StockQuotePrinter
{
class Program
{
static void Main(string[] args)
package main
import (
"encoding/xml"
"fmt"
"io/ioutil"
"net/http"
"runtime"
"time"
)
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Xml;
namespace StockQuotePrinter
{
class Program
namespace StashFileFetcher.Controllers
{
using System.Diagnostics;
using System.IO;
using System.Text;
using LibGit2Sharp;
class RepoDigger : IDisposable
{
public static RepoDigger GetRepositoryInformationForPath(string path)
%BuildToolsPath%\GitLink.exe c:\git\myLocalGitProjectFolder -u "http://vm-hd87-ug84:8081/api/%var2%/%revision%" -b %branchname% -c debug -powershell -errorsaswarnings
- %BuildToolsPath% is the path to build tools on my build machine.
- %var2% is a placeholder that will be replaced by the file name when debugging. This is the only placeholder that should not be expanded by the build system. It is for the debugger's use only.
- %revision% is the git revision number that should be expanded by the build system to the current revision being built.
- %branchname% should also expand by the build system to the current branch name that is being built.
Optional<Person> person = getPerson();
if(person.isPresent()){
System.out.println(person.get().sayHi());
}
Person person = getPerson();
if(person != null){
System.out.println(person.sayHi());
}
public ApiResponse getPerson(int id) {
Person person = repository.get(id);
if(person != null){
return createdSuccessfulResponse(person);
}
else{
return createFailedResponse();
}
}
var s1 = Symbol();
var s2 = Symbol();
console.log(s1 == s2); // false