Have [SBT plugin][sbt-plugin] installed
- [Create a new project][create-project] in IDEA ( File > New Project ...)
- Make sure you select a maven module
using System; | |
using ServiceStack; | |
using ServiceStack.Text; | |
public class GetPersonResponse | |
{ | |
public string FirstName { get;set; } | |
public string LastName { get;set; } | |
public int Age { get;set; } | |
} |
using System; | |
using ServiceStack; | |
using ServiceStack.Text; | |
public class GetPersonResponse | |
{ | |
public string FirstName { get;set; } | |
public string LastName { get;set; } | |
public int Age { get;set; } | |
public string PostCode { get;set; } |
#!/bin/sh | |
export PATH=/usr/local/bin:$PATH; | |
yum update | |
yum install docker -y | |
service docker start | |
# Docker login notes: | |
# - For no email, just put one blank space. | |
# - Also the private repo protocol and version are needed for docker | |
# to properly setup the .dockercfg file to work with compose |
using ServiceStack; | |
using ServiceStack.Text; | |
using ServiceStack.OrmLite; | |
using ServiceStack.OrmLite.Sqlite; | |
using ServiceStack.DataAnnotations; | |
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider); | |
var db = dbFactory.Open(); // Open ADO.NET DB Connection | |
public class Foo |
import solcast | |
# Fetch latest PV power forecast | |
pv_power_resp = solcast.get_pv_power_forecasts(-35, 149, capacity=2000, tilt=23, azimuth=0, api_key='INSERTYOURAPIKEYHERE') | |
# Print soonest PV power forecast | |
print(pv_power_resp.forecasts[0]['pv_estimate']) |
Create an application that: | |
1. Loops 100 times | |
2. Pauses for 200ms each loop | |
3. Writes 'Fizz' to the console when loop count is divisable by 2 | |
4. Writes 'Buzz' to the console when loop count is divisable by 5 | |
5. Writes 'FizzBuzz' to the console when loop count is divisable by both | |
Extra | |
Setup project to write a unit test using NUnit, walk through project steps you need to enable this. |
using System.Linq; | |
using System; | |
using ServiceStack; | |
using ServiceStack.Text; | |
public enum Foo | |
{ | |
None, | |
Test, | |
Bar |
// Connect your database | |
container.AddSingleton<IDbConnectionFactory>(c => | |
new OrmLiteConnectionFactory(MapProjectPath("~/northwind.sqlite"), SqliteDialect.Provider)); | |
// Configure AutoQuery to Generate CRUD services | |
Plugins.Add(new AutoQueryFeature { | |
MaxLimit = 1000, | |
GenerateCrudServices = new GenerateCrudServices { | |
AutoRegister = true | |
} |
// Connect your database | |
container.AddSingleton<IDbConnectionFactory>(c => | |
new OrmLiteConnectionFactory(MapProjectPath("~/northwind.sqlite"), SqliteDialect.Provider)); | |
// Add the AutoQuery Plugin | |
Plugins.Add(new AutoQueryFeature { MaxLimit = 100 }); |