This file contains hidden or 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
| # !/usr/bin/env python3 | |
| # | |
| # libtcod python tutorial | |
| # | |
| import math | |
| import shelve | |
| import textwrap | |
| import libtcodpy as libtcod |
This file contains hidden or 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
| wget --no-check-certificate -O - https://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add - | |
| echo 'deb http://debian.neo4j.org/repo stable/' | sudo tee /etc/apt/sources.list.d/neo4j.list | |
| sudo apt update | |
| sudo apt install neo4j | |
| sudo service neo4j start |
This file contains hidden or 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
| # maximum capability of system | |
| user@ubuntu:~$ cat /proc/sys/fs/file-max | |
| 708444 | |
| # available limit | |
| user@ubuntu:~$ ulimit -n | |
| 1024 | |
| # To increase the available limit to say 200000 | |
| user@ubuntu:~$ sudo vim /etc/sysctl.conf |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <title>Perspective</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <script type="module"> | |
| import { html, render } from 'https://unpkg.com/lit-html/lib/lit-extended.js?module'; |
This file contains hidden or 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
| defmodule Server.SessionPlug do | |
| @behaviour Plug | |
| import Plug.Conn | |
| require Logger | |
| def init(opts), do: opts | |
| def call(conn, _) do | |
| Logger.info "SessionPlug: Looking for session for player" |
This file contains hidden or 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
| require Logger | |
| alias Server.Repo | |
| alias Server.Character | |
| defmodule Server.World do | |
| @online %{} | |
| def join(character) do | |
| online = Map.put @online, character.id, character | |
| Logger.info "character #{inspect character.name} has come online" |
This file contains hidden or 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
| def new_character(struct, params \\ %{}) do | |
| struct | |
| |> cast(params, [:name, :player_id, :class_id]) | |
| |> validate_required([:name, :class_id, :player_id]) | |
| |> cast_assoc(:class, required: true) | |
| |> cast_assoc(:player, required: true) | |
| end |
This file contains hidden or 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
| ** (Ecto.QueryError) the binding used in `from` must be selected in `select` when using `preload` in query: | |
| from c in Server.Character, | |
| where: c.player_id == ^..., | |
| select: {c.name, c.id, c.class_id, c.experience, c.gold, c.level, c.weapon_id, c.armor_id, c.health, c.defense}, | |
| preload: [:class, :weapon, :armor] |
This file contains hidden or 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
| defmodule Server.CharacterChannel do | |
| use Server.Web, :channel | |
| alias Phoenix.View | |
| alias Server.CharacterView | |
| alias Server.Repo | |
| alias Server.Player | |
| alias Server.Character | |
| alias Ecto.Query |
This file contains hidden or 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
| import Ember from 'ember'; | |
| export default Ember.Component.extend({ | |
| currentUsername: '', | |
| currentSecret: '', | |
| dataService: Ember.inject.service(), | |
| actions: { | |
| updateUsername() { |
NewerOlder