Skip to content

Instantly share code, notes, and snippets.

View riccardone's full-sized avatar

Riccardo Di Nuzzo riccardone

View GitHub Profile
@riccardone
riccardone / gist:278eaeddfab33479dbe545e291949732
Created February 28, 2018 19:24
httpclient generic post
public async Task<string> Post<T>(string path, T data)
{
using (var client = new HttpClient())
{
client.Timeout = new TimeSpan(0, 0, 5);
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var json = JsonConvert.SerializeObject(data);
@riccardone
riccardone / app.component.html
Last active February 19, 2017 08:09
Angular2 Customers module example
<ul>
<li *ngFor="let customer of customersList">{{customer.name}}</li>
</ul>
@riccardone
riccardone / gist:29bcdf99588b2c22022f5eaef0c9de39
Created February 10, 2017 20:45
Apache2 Angular2 static website Dockerfile
FROM ubuntu:16.04
RUN apt update
RUN apt install -y apache2
COPY dist /var/www/html
CMD /usr/sbin/apache2ctl -D FOREGROUND
EXPOSE 80