Skip to content

Instantly share code, notes, and snippets.

#
# Automatically generated make config: don't edit
# Linux/arm 3.0.36 Kernel Configuration
#
CONFIG_ARM=y
@avionbg
avionbg / fileFromTemplateCommand.js
Created August 24, 2017 09:23
Bugfix for vscode-file-templates-ext - making multiple variables work
"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
@avionbg
avionbg / mine_exploder.py
Last active February 2, 2018 23:33
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
avionbg / mine_exploder_performance_test.py
Last active February 5, 2018 22:57
Test performance between recursion and ahead calculation with looping trough collections
import numpy as np
import timeit
from collections import deque
NUMBER_OF_MINES = 10 ** 5
# 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)
MAX_BLAST_RADIUS = 200
MAX_COORDINATE_XY = 700000
@avionbg
avionbg / Menu.html
Last active May 13, 2018 20:05 — forked from NamelessCoder/Menu.html
Rendering manual menus with VHS
<div xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
<!-- By setting the "as" argument, we create a new variable accessible inside tag content -->
<v:page.menu as="myMenuVariable">
<ol class="mySpecialMenu">
<f:for each="{myMenuVariable}" as="menuPage">
<li>
<!-- A few key properties are added on {menuPage} for user friendliness -->
<!-- These are: "linktext", "link", "active", "current", "hasSubPages" -->
<f:if condition="{menuPage.current}">