Skip to content

Instantly share code, notes, and snippets.

View azatoth's full-sized avatar

Carl Fürstenberg azatoth

  • Purple Scout AB
  • Malmö
View GitHub Profile
@azatoth
azatoth / git-delete-gone-branches
Last active December 2, 2022 13:27 — forked from GrayedFox/git-glean
Remove local branches with a missing (gone) upstream
#!/usr/bin/env bash
# reset environment variables that could interfere with normal usage
unset GREP_OPTIONS
#
# check whether current directory is inside a git repository
#
is_git_repo() {
git rev-parse --show-toplevel >/dev/null 2>&1
@azatoth
azatoth / grammar.ne
Last active April 25, 2023 14:22
Nearly grammer for TFRs
@{%
const { DateTime } = require("luxon");
%}
@builtin "postprocessors.ne"
@builtin "whitespace.ne"
notam -> "!" prefix __
notam_id __
airspace __
part:? _
@azatoth
azatoth / current.js
Last active December 4, 2020 21:52
Current TFRs for SpaceX in Boca Chica
const fetch = require("node-fetch");
const date_fns = require("date-fns");
const date_fns_tz = require("date-fns-tz");
const indentString = require("indent-string");
const chalk = require("chalk");
const params = new URLSearchParams({
searchType: "0",
designatorsForLocation: "ZHU",
offset: "0",
Path.find = function (filter, options, callback) {
var PrivMgr = app.PrivilegeManager;
if (!callback) {
callback = options;
}
callback = callback || ldjutils.createPromiseCallback();
var cfg = Path.app.get('cache');
var _memCache = cacheManager.caching(cfg);
var key = `path_${JSON.stringify(filter)}`;
_memCache.wrap(key, (cacheCallback) => {
var path = require('path');
var Q = require('q');
Q.longStackSupport = true;
module.exports = function (Content) {
Content.observe('before save', (ctx, next) => {
function getOldContent(name, pathId, counter, cb) {
var parsed = path.parse(name);
var filename = counter === 1 ? name : `${parsed.name} (${counter})${parsed.ext}`;
#!/usr/bin/perl
use strict;
use warnings;
use v5.18;
use Config::General;
use File::Find::Wanted;
use File::Slurp;
@azatoth
azatoth / BlockRecyclerBlock.java
Created January 5, 2014 19:54
Trial to make a IC2 addon (code layout idea borrowed from Advanced Machines)
package azatoth.mc.recycler;
import ic2.api.item.Items;
import azatoth.mc.recycler.client.ClientProxy;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 " «%s»")\$ '
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWSTASHSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
GIT_PS1_SHOWUPSTREAM="git verbose"
[All-Projects]
checkout = git clone 'https://gerrit.wikimedia.org/r/All-Projects' 'All-Projects'
[USERINFO]
checkout = git clone 'https://gerrit.wikimedia.org/r/USERINFO' 'USERINFO'
[VisualEditor]
checkout = git clone 'https://gerrit.wikimedia.org/r/VisualEditor' 'VisualEditor'
@azatoth
azatoth / pexconvert.pl
Created August 11, 2012 18:10
convert Minecraft Bukkit PermissionEX PEX SQL to flat file format
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
use YAML::Tiny;
my $permissions = {
'users' => {},