Skip to content

Instantly share code, notes, and snippets.

View saevarb's full-sized avatar

Sævar Berg saevarb

  • NTT Data BS Nordics
  • Odense, Denmark
View GitHub Profile
#!/usr/bin/env bash
# This will not work with set -e because killing ffmpeg means whole script
# ends.
set -xuo pipefail
dorecord() {
local filename="$(date "+%F_%V_%H-%M-%S").webm"
local start="$(date "+%s")"
src
├── ai
│   ├── mage.ts
│   ├── merchant.ts
│   ├── pathfinding
│   │   └── pathfinder.ts
│   ├── priest.ts
│   └── ranger.ts
├── behaviors
│   ├── DeadBehavior.ts
public class Map
{
private Dictionary<Tuple<int,int>, Tile> specialTileMap = new Dictionary<Tuple<int, int>, Tile>();
private Dictionary<Tuple<int,int>, Tile> allTileMap = new Dictionary<Tuple<int, int>, Tile>();
private List<Tile> fillerTileList;
private List<Tile> resourceTileList;
private List<Tile> constructionTileList;
const int tileCount = 40;
int tileWidth;
int tileHeight;
import webpack from "webpack";
import path from "path";
import fs from "fs";
import http from "http";
import querystring from "querystring";
// These (1) must each match one of (2) -- see (2) below
const fileSlots: string[] = ["priest", "mage", "ranger", "merchant"];
// get this by looking for the authentication header in an authenticated request
import { IComponent } from "./Component";
import { positionToVec, Vector } from "./utils";
import { Drawing } from "./game";
import { PriorityQueue } from "./PriorityQueue";
import { BotManager } from "./BotManager";
class SearchNode {
public readonly position: Vector;
public parent?: SearchNode;
public fScore: number;
module Day1 where
import Data.List
import qualified Data.Set as S
readInput :: IO [Int]
readInput =
(map (read . clean) . lines) <$> readFile "input/day1"
where
clean ('+':xs) = xs
clean xs = xs
module Day1 where
import Data.List
import qualified Data.Set as S
readInput :: IO [Int]
readInput =
(map (read . clean) . lines) <$> readFile "input/day1"
where
clean ('+':xs) = xs
clean xs = xs
import random
import time
import timeit
from math import floor
import matplotlib.pyplot as draw
import scipy.io
import numpy as np
import cProfile
import math
import random
import time
import timeit
from math import floor
import matplotlib.pyplot as draw
import scipy.io
import numpy as np
import cProfile
{-# LANGUAGE OverloadedStrings #-}
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.EwmhDesktops
import XMonad.Util.Run(spawnPipe, safeSpawn)
import XMonad.Util.NamedScratchpad
import XMonad.Util.EZConfig