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.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.EntityFrameworkCore; | |
using ProjectAPI.Models; | |
namespace ProjectAPI.Controllers |
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
// This is our custom exception | |
public class TakenUsernameException : System.Exception | |
{ | |
public TakenUsernameException() { } | |
public TakenUsernameException(string message) : base(message) { } | |
public TakenUsernameException(string message, System.Exception inner) : base(message, inner) { } | |
} | |
class MyApp { |
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
const fetch = require('node-fetch'); | |
const {spawn} = require('child_process'); | |
const readline = require('readline'); | |
const SERVER_LOG = '/home/minecraft/server/logs/latest.log'; | |
const WEBHOOK = 'SLACK_WEBHOOK_HERE'; | |
const REGEX = /^(\[\d\d:\d\d:\d\d\] \[.*\]: )((<[^ ]*\>)|([^ ]* (left|joined) the game))|(.*)(shot by|to death|cactus|drowned|experienced kinetic|removed an elytra|blew up|blown up|hit the ground|fell|doomed to fall|shot off|blown|squashed|flames|burned|burnt|fire|bang|lava|lightning|slain by|finished off|fireballed|killed by|starved|suffocated|squished|fell out|withered away|pummeled by|pummeled|died)/; | |
const tail = spawn('/usr/bin/tail', ['-n0', '-f', SERVER_LOG]); | |
const rl = readline.createInterface({input: tail.stdout}); |
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
IN: 2 x 3 + 2 ^ * 4 x 1 - x 2 + * * + 3 x 1 + * + 4 x * - 6 + | |
EXP: 6x^2 + 15x + 19 | |
OUT: 6x^2 + 15x + 19 | |
PASS | |
IN: x 2 ^ 3 - 1 2 x * - * | |
EXP: -2x^3 + x^2 + 6x - 3 | |
OUT: -2x^3 + x^2 + 6x - 3 | |
PASS |
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
[Unit] | |
Description=Home Assistant | |
After=network.target | |
[Service] | |
Type=simple | |
User=homeassist | |
ExecStart=/home/homeassist/run_hass.sh | |
[Install] |