Skip to content

Instantly share code, notes, and snippets.

View tedivm's full-sized avatar

Robert Hafner tedivm

View GitHub Profile

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@resir014
resir014 / loan-screeps-alliances.md
Last active September 28, 2016 12:17
Screeps alliances list.

League of Automated Nations - Screeps Alliances

This list is no longer updated. Please go here for an up-to-date list.


This gist documents player alliances known to exist on Screeps as of 2016-09-25 11:00 UTC.

We're in the process of developing a diplomatic dashboard to track alliances and treaties. For more information, check out the #loan channel on the Screeps Slack.

@AlinaNova21
AlinaNova21 / main.js
Created September 14, 2016 04:53
Screeps Source Keeper Source
PathFinder.use(true);
for (var i in Game.creeps) {
var creep = Game.creeps[i], source = undefined;
if (!creep.room) {
continue;
}
if (creep.memory.sourceId) {
source = Game.getObjectById(creep.memory.sourceId);
}
if(!source) {
@AlinaNova21
AlinaNova21 / findAttack.js
Created September 14, 2016 04:45
Screeps Invader Source Code
var flee = require('flee');
function checkPath(pos1, pos2) {
var path = pos1.findPathTo(pos2);
if (!path.length) {
return false;
}
return path[path.length - 1].x == pos2.x && path[path.length - 1].y == pos2.y;
}
function costCallbackIgnoreRamparts(roomName, cm) {
var ramparts = Game.rooms[roomName].find(FIND_STRUCTURES, {filter: i => i.structureType == STRUCTURE_RAMPART || i.structureType == STRUCTURE_WALL});
@dwilkie
dwilkie / docker-cheat-sheat.md
Last active January 18, 2024 10:56
Docker Cheat Sheet

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes

#!/bin/bash
# Check if a value exists in an array
# @param $1 mixed Needle
# @param $2 array Haystack
# @return Success (0) if value exists, Failure (1) otherwise
# Usage: in_array "$needle" "${haystack[@]}"
# See: http://fvue.nl/wiki/Bash:_Check_if_array_element_exists
in_array() {
local hay needle=$1
@RichardBronosky
RichardBronosky / pep8_cheatsheet.py
Created December 27, 2015 06:25
PEP-8 cheatsheet
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py
@dzhu
dzhu / screeps.py
Last active November 14, 2020 10:18
description of the HTTP endpoints available from Screeps, and a Python wrapper to access them (requires requests library)
import json
from base64 import b64decode
from collections import OrderedDict
from cStringIO import StringIO
from gzip import GzipFile
import requests
## Python before 2.7.10 or so has somewhat broken SSL support that throws a warning; suppress it
@zenorocha
zenorocha / .hyper.js
Last active November 12, 2023 15:13 — forked from millermedeiros/osx_setup.md
Setup macOS Sierra (10.12)
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks