Skip to content

Instantly share code, notes, and snippets.

@airstrike
airstrike / generate.c
Last active April 16, 2020 19:28 — forked from Joker-vD/generate.c
Dungeon Generator (Uncompressed, MS Visual Studio 2008)
// Uncompressed version of dungeon generator, backported for MS Visual Studio 2008
// Original work: https://gist.github.com/munificent/b1bcd969063da3e6c298be070a22b604
// Original uncompressed version: https://gist.github.com/Joker-vD/cc5372a349559b9d1a3b220d5eaf2b01
// Tested with Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
// #include <stdbool.h> // 2008-2019
typedef int bool;
#include <stdio.h>
#include <stdlib.h>
const int H = 40;
const int W = 80;
char map[H][W];
int rnd(int max) {
return rand() % max;
@munificent
munificent / generate.c
Last active May 14, 2024 05:30
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@cellularmitosis
cellularmitosis / solutions-by-exercise.md
Last active May 25, 2021 21:20
Index of Exercism.io solutions, grouped by problem

Blog 2019/1/25

<- previous | index | next ->

Index of solutions to Exercism.io problems (grouped by exercise)

Browsing solutions to the same problem is a great way to compare languages!

@cellularmitosis
cellularmitosis / solutions-by-language.md
Last active May 25, 2021 21:20
Index of Exercism.io solutions, grouped by language

Blog 2019/1/25

<- previous | index | next ->

Index of solutions to Exercism.io problems (grouped by language)

Browsing solutions is a great way to quickly familiarize yourself with a new language!

<application>
<component name="RainbowSettings">
<option name="rainbowifyHTMLInsideJS" value="true" />
<option name="version" value="5.1" />
<option name="lightRoundBracketsColors">
<array>
<option value="0x263238" />
<option value="0x455a64" />
<option value="0x607d8b" />
<option value="0x90a4ae" />
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active June 25, 2024 07:29
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@marianogappa
marianogappa / ordered_parallel.go
Last active February 12, 2024 09:27
Parallel processing with ordered output in Go
/*
Parallel processing with ordered output in Go
(you can use this pattern by importing https://github.com/MarianoGappa/parseq)
This example implementation is useful when the following 3 conditions are true:
1) the rate of input is higher than the rate of output on the system (i.e. it queues up)
2) the processing of input can be parallelised, and overall throughput increases by doing so
3) the order of output of the system needs to respect order of input
- if 1 is false, KISS!
@marianogappa
marianogappa / backpressure.go
Created December 4, 2016 04:53
Example backpressure implementation in Go
/*
This snippet is an example of backpressure implementation in Go.
It doesn't run in Go Playground, because it starts an HTTP Server.
The example starts an HTTP server and sends multiple requests to it. The server starts denying
requests by replying an "X" (i.e. a 502) when its buffered channel reaches capacity.
This is not the same as rate-limiting; you might be interested in https://github.com/juju/ratelimit
or https://godoc.org/golang.org/x/time/rate.
@BrianSipple
BrianSipple / ember-addon-readme-badge-template.md
Last active September 7, 2020 10:06
Useful Badges to Include in an Ember Addon's README
[![Latest NPM release][npm-badge]][npm-badge-url]
[![TravisCI Build Status][travis-badge-url]][travis-project-url]
[![CircleCI Build Status][circle-badge]][circle-badge-url]
[![Test Coverage][coveralls-badge]][coveralls-badge-url]
[![Code Climate][codeclimate-badge]][codeclimate-badge-url]
[![Ember Observer Score][ember-observer-badge]][ember-observer-badge-url]
[![License][license-badge]][license-badge-url]
[![Dependencies][dependencies-badge]][dependencies-badge-url] 
[![Dev Dependencies][devDependencies-badge]][devDependencies-badge-url]