Skip to content

Instantly share code, notes, and snippets.

Avatar

Carl Fürstenberg azatoth

  • Purple Scout AB
  • Malmö
View GitHub Profile
@azatoth
azatoth / current.js
Last active Dec 4, 2020
Current TFRs for SpaceX in Boca Chica
View current.js
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",
View Path.es6
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) => {
View content.js
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}`;
View check_translations.pl
#!/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 Jan 5, 2014
Trial to make a IC2 addon (code layout idea borrowed from Advanced Machines)
View BlockRecyclerBlock.java
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;
View bash git ps1
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"
View .mrconfig
[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 Aug 11, 2012
convert Minecraft Bukkit PermissionEX PEX SQL to flat file format
View pexconvert.pl
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
use YAML::Tiny;
my $permissions = {
'users' => {},
@azatoth
azatoth / diskdaemon.pl
Created Nov 25, 2011
Current diskdaemon.pl
View diskdaemon.pl
#!/usr/bin/perl -w
use strict;
use v5.10;
use Proc::Daemon;
use Sys::Syslog;
@azatoth
azatoth / multiline echo
Created Jun 16, 2011
echo static multi line data in makefile
View multiline echo
define data
foo
bar
baz
endef
export data
all:
@echo "$$data"