This file contains 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.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using StackExchange.Redis; | |
namespace CitySurvival.Redis | |
{ |
This file contains 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
/* | |
* Copyright 2017 Ben D'Angelo | |
* | |
* MIT License | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
* software and associated documentation files (the "Software"), to deal in the Software | |
* without restriction, including without limitation the rights to use, copy, modify, merge, | |
* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons | |
* to whom the Software is furnished to do so, subject to the following conditions: |
This file contains 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 UnityEngine; | |
public class CubePlacer : MonoBehaviour | |
{ | |
private Grid grid; | |
private void Awake() | |
{ | |
grid = FindObjectOfType<Grid>(); | |
} |
This file contains 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 UnityEngine; | |
public class Grid : MonoBehaviour | |
{ | |
[SerializeField] | |
private float size = 1f; | |
public Vector3 GetNearestPointOnGrid(Vector3 position) | |
{ | |
position -= transform.position; |
This file contains 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 Car { | |
public int Id { get; set; } | |
[Required] | |
[StringLength(20)] | |
public string Make { get; set; } | |
[Required] | |
[StringLength(20)] |
This file contains 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
use std::collections::HashMap; | |
fn main() { | |
struct User<'a> { | |
name: &'a str, | |
} | |
impl<'a> User<'a> { | |
fn new(uname: &'a str, pwd: &'a str) -> User<'a> { | |
User { name: uname } |
This file contains 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
pub struct TextEditor { | |
text: String //Private member variable | |
} | |
impl TextEditor { | |
pub fn new() -> TextEditor { | |
TextEditor{text: String::new()} | |
} | |
pub fn add_char(&mut self, ch : char) { |
This file contains 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
#[derive(Debug)] | |
struct Person { | |
name: String, | |
never_change_this: i32, | |
} | |
impl Person { | |
fn new(name: String, never_change_this: i32) -> Person { | |
Person { | |
name: name, | |
never_change_this: never_change_this, |
This file contains 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; | |
namespace Example | |
{ | |
public abstract class ExecutionResult | |
{ | |
protected ExecutionResult(Guid aggregateId, Guid commandId, DateTime executedOn) | |
{ | |
AggregateId = aggregateId; | |
CommandId = commandId; |
This file contains 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 static void Main(string[] args) | |
{ | |
var app = new Microsoft.Extensions.CommandLineUtils.CommandLineApplication(); | |
var catapult = app.Command("catapult", config => { | |
config.OnExecute(()=>{ | |
config.ShowHelp(); //show help for catapult | |
return 1; //return error since we didn't do anything | |
}); | |
config.HelpOption("-? | -h | --help"); //show help on --help | |
}); |
NewerOlder