Skip to content

Instantly share code, notes, and snippets.

avionbg / Menu.html
Last active May 13, 2018 — forked from NamelessCoder/Menu.html
Rendering manual menus with VHS
View Menu.html
<div xmlns:v=""
<!-- By setting the "as" argument, we create a new variable accessible inside tag content -->
< as="myMenuVariable">
<ol class="mySpecialMenu">
<f:for each="{myMenuVariable}" as="menuPage">
<!-- A few key properties are added on {menuPage} for user friendliness -->
<!-- These are: "linktext", "link", "active", "current", "hasSubPages" -->
<f:if condition="{menuPage.current}">
avionbg /
Last active Feb 5, 2018
Test performance between recursion and ahead calculation with looping trough collections
import numpy as np
import timeit
from collections import deque
# Keep this low to prevent RuntimeError: maximum recursion depth exceeded
# (we can increase recursion depth, but it's ok also to avoid it just for the test)
avionbg /
Last active Feb 2, 2018
Python script to calculate chain reactions
import os.path
def within_blast_radius(x1, y1, blast_radius, x2, y2):
# Note that this counts points on the edge of the radius which is incorrect
# Proper way would be to exclude them as they are not in the radius (replace <= with <)
return ((x1 - x2) ** 2 + (y1 - y2) ** 2) <= (blast_radius ** 2)
def explode_mine(mines, mine, exploded):
"""Recursive explosion calculation
avionbg / fileFromTemplateCommand.js
Created Aug 24, 2017
Bugfix for vscode-file-templates-ext - making multiple variables work
View fileFromTemplateCommand.js
"use strict";
var vscode = require("vscode");
var fs = require("fs");
var path = require("path");
var helpers = require("../helpers");
var moment = require("moment");
* Main command to create a file from a template.
* This command can be invoked by the Command Palette or in a folder context menu on the explorer view.
* @export
View gist:72339ab9da75e9a95be9
# Automatically generated make config: don't edit
# Linux/arm 3.0.36 Kernel Configuration
You can’t perform that action at this time.