Skip to content

Instantly share code, notes, and snippets.

/* @license GPL-2.0+ */
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
from django.http import HttpResponse
_current_shutdown_middleware = None
# Used in situations where it must shutdown before it gets initialized
_pre_shutdown = False
class ShutdownMiddleware(object):
shutting_down = False
import std.stdio;
import std.math;
import core.time;
import core.time;
real myFmax(real a, real b) {
if (a > b) return a;
else return b;
}
attaaaggtttataccttcccaggtaacaaaccaaccaactttcgatctcttgtagatctgttctctaaacgaactttaaaatctgtgtggctgtcactcggctgcatgcttagtgcactcacgcagtataattaataactaattactgtcgttgacaggacacgagtaactcgtctatcttctgcaggctgcttacggtttcgtccgtgttgcagccgatcatcagcacatctaggtttcgtccgggtgtgaccgaaaggtaagatggagagccttgtccctggtttcaacgagaaaacacacgtccaactcagtttgcctgttttacaggttcgcgacgtgctcgtacgtggctttggagactccgtggaggaggtcttatcagaggcacgtcaacatcttaaagatggcacttgtggcttagtagaagttgaaaaaggcgttttgcctcaacttgaacagccctatgtgttcatcaaacgttcggatgctcgaactgcacctcatggtcatgttatggttgagctggtagcagaactcgaaggcattcagtacggtcgtagtggtgagacacttggtgtccttgtccctcatgtgggcgaaataccagtggcttaccgcaaggttcttcttcgtaagaacggtaataaaggagctggtggccatagttacggcgccgatctaaagtcatttgacttaggcgacgagcttggcactgatccttatgaagattttcaagaaaactggaacactaaacatagcagtggtgttacccgtgaactcatgcgtgagcttaacggaggggcatacactcgctatgtcgataacaacttctgtggccctgatggctaccctcttgagtgcattaaagaccttctagcacgtgctggtaaagcttcatgcactttgtccgaacaactggactttattgacactaagaggggtgtatactgctgccgtgaacatgagcatgaaattgcttggtacacggaacgttctgaaaagagctatgaattgcagaca

'Just enough' theory to start using CSS.

This is intended for programmers used to imperative programming, but have always felt frustrated with CSS, unable to grok it.

CSS has two important modes, box and flex.

Every CSS element has a default size.

This default size is what it renders as if you don't add any CSS.

int[3] newArr;
{
int i = 0;
foreach (int id; neighborhood) {
if (id != 0)
newArr[i++] = id;
}
}
int nextColor;
if (newArr[0] == newArr[1]) {
@CrazyPython
CrazyPython / How to build DPP on Ubuntu.md
Last active September 5, 2019 18:55
How to build DPP on Ubuntu for Dlang

How to build DPP on Ubuntu

  1. install libclang-6.0-dev
  2. add dpp to your dependencies in your dub project
  3. dub run dpp
@CrazyPython
CrazyPython / heaps.py
Last active August 20, 2019 13:25
Simple heap wrapper library.
import heapq
class Heap(object):
_heap = []
def __init__(self, l=()):
_heap = list(l)
heapq.heapify(_heap)
# Leadership
Syncinus, I think it’s best if you and the other devs hunker down and keep developing ArraX while I’m gone.
You are my deputy. You will be the king of ArraX while I’m gone.
If you choose to actively promote ArraX, you need 1) get confirmed 60fps under multiple tests 2) get a discussable gamemode in- the one I have in mind is CTHD 3) set up a system where you can buy servers dynamically based on how much demand.
It is absolutely imperative that you DO NOT promote ArraX until all 3 conditions are met. When I am back on the 5th, I can help implement all 3. It is crucial because you only have ONE chance to sell ArraX to Diep players.
## Motivation
Motivation and other’s self-confidence is a crucial element of how effective you effecticw your team is. Trust me on this one. Different things motivate different people. I nudge developers into working on Arras by giving them the self-confidence to try. I remind them that if they fail, as long as they tried, they can always talk about their failure.
/** START GAMEMODE FILE **/
// gamemode files would be best in CoffeeScript
// real width is 3000
// food was originally 800, food would add an element of dodging
// this mode should have the leaderboard disabled on the client
// npm install driftless for more accurate timing
// also could npm install driftless help make arras faster, by maing gameloop execute more accurately?
gamemode = {}
gamemode.flagCarriers = []
gamemode.flagTimes = {}