Skip to content

Instantly share code, notes, and snippets.

View bench.js
/* eslint-disable github/array-foreach */
const bytes = new Uint8Array(10_000);
for (let i = 0; i < bytes.length; i++) {
bytes[i] = Math.floor(Math.random() * 256);
const set = new Set();
const ITERATIONS = 100_000;
View Pagination.svelte
<script lang="ts">
import { classnames } from '@/utils';
import { Pagination, PaginationItem, PaginationLink } from 'sveltestrap';
export let align: "right" | "left" | "center" | undefined = undefined
export let title = "Pagination"
export let count: number
export let perPage: number
export let currentPage = 0
let className = ""
use std::io::{stdin, stdout, Write};
fn main() {
let stdin = stdin();
let mut stdout = stdout();
let to_guess = String::from("BENEDICT");
let mut letters: u128 = 0;
View data.json
coyotte508 /
Created August 6, 2018 19:54

When doing a fresh install, yarn takes the latest versions of the packages according to semver.

Then it creates a yarn.lock file, and won't upgrade the packages anymore.

Yarn upgrade only upgrades the modules installed locally. It has no effect for anybody else as it does not modify package.json.

Upgrading gaia-engine on the website

Option 1

View stream-concat.js
var Transform = require('stream').Transform;
class StreamConcat extends Transform {
constructor(streams, options) {
this.streams = streams;
this.canAddStream = true;
this.currentStream = null;
this.streamIndex = 0;
coyotte508 /
Last active December 31, 2015 10:39
#pythran export run()
def init(x):
global a
a = x
def show():
def run():
View main.cpp
#include <pythran/pythran.h>
/* Module name, function name, argument types */
pythran_export_solo(test, init, int)
#include "test.cpp"
namespace test = namespace __pythran_test;
int main() {
coyotte508 / gist:7744420
Created December 2, 2013 03:12
Server release
View gist:7744420

Release for Servers

This new release is a major release for server owners. We had problems with crashes -- between other things --, and so we did an overhaul of the way things were done.

There are two major changes:

  • The database system was completely changed. No more using SQL, instead text files in a folder named "serverdb".
  • Battles are in a separate process, a "battle server". Essentially means no crashes and hot updates.
coyotte508 / gist:7506961
Created November 16, 2013 23:44
List image sizes in current dir
View gist:7506961
find ./* -prune -type f -name "*.png" -exec convert {} -print "{}=%wx%h\n" /dev/null \;