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 / xvim
Created May 11, 2011 09:44
Open gvim in same window when on same "desktop"
#!/bin/bash
this=$(basename $0); # vim|gvim|rvim etc...
desktop=desktop_$(xprop -root -notype _NET_CURRENT_DESKTOP | perl -pe 's/.*?= (\d+)/$1/')
number_desktop=$(xprop -root -notype _NET_NUMBER_OF_DESKTOPS | perl -pe 's/.*?= (\d+)/$1/')
viewport=viewport_$(xprop -root -notype _NET_DESKTOP_VIEWPORT | perl -pe 's/.*?= (\d+), (\d+)/$1x$2/')
if [ $number_desktop = 1 ]; then
desktop=$viewport;
fi
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) => {
@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",
@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 / multiline echo
Created June 16, 2011 19:50
echo static multi line data in makefile
define data
foo
bar
baz
endef
export data
all:
@echo "$$data"