Skip to content

Instantly share code, notes, and snippets.

@MarkWarneke
MarkWarneke / Makefile
Created June 18, 2020 12:25
Makefile for python code
# Makefile for python code
#
# > make help
#
# The following commands can be used.
#
# init: sets up environment and installs requirements
# install: Installs development requirments
# format: Formats the code with autopep8
# lint: Runs flake8 on src, exit if critical rules are broken
@triman
triman / MgrsHelper.cs
Last active March 28, 2024 20:56
Helper class to handle MGRS and UTM coordinates and convert <=> Wgs84. This is a C# port of https://github.com/proj4js/mgrs
using System;
using System.Linq;
using System.Text.RegularExpressions;
namespace MgrsConverter
{
/// <summary>
/// C# port of https://github.com/proj4js/mgrs
/// </summary>
public static class MgrsHelper
@markasoftware
markasoftware / enterprise_token.rb
Last active March 28, 2024 20:54
OpenProject Enterprise mode for free
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################
############ also be sure to RESTART OpenProject after replacing the file. ################
############ it doesn't show that enterprise mode is enabled in the settings, but all ################
############ enterprise mode features, such as KanBan boards, are enabled. ################
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
@renderedSafe
renderedSafe / diffbot_system.cpp
Last active March 28, 2024 20:53
ROS2 Control Demos diffbot hardware interface publisher. Useful for micro-ROS hardware control.
// Copyright 2021 ros2_control Development Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active March 28, 2024 20:53 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@abdennour
abdennour / README.md
Last active March 28, 2024 20:53
Nginx Reverse Proxy for Nexus Docker Registries

Overview

This is a solution of a common problem with Nexus Docker repositories. The administrator has to expose port for "pull", another port for "push", other ports for each hosted repository. This solution is about leveraging Nginx reverse proxy to avoid using these ports.

How it works ?

Given :

  • Nexus hostname is "nexus.example.com"
  • Nexus web port is 8081
@mikowl
mikowl / oneliners.js
Last active March 28, 2024 20:52
👑 Awesome one-liners you might find useful while coding.
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// or
const sleep = util.promisify(setTimeout);
@styblope
styblope / docker-api-port.md
Last active March 28, 2024 20:51
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@dafurman
dafurman / GQL+Conveniences.swift
Created March 29, 2023 19:42
Apollo GraphQLNullable Conveniences
import ApolloAPI
import Foundation
public extension EnumType {
var gqlEnum: GraphQLEnum<Self> {
GraphQLEnum(self)
}
/// Converts an `EnumType` into a `GraphQLNullable<GraphQLEnum<EnumType>>` for compatibility with GQL query and mutation inputs.
var gqlEnumNullable: GraphQLNullable<GraphQLEnum<Self>> {
@RDeluxe
RDeluxe / sentry.ts
Created January 19, 2021 10:42
Sentry Interceptor for Nestjs
///// SERVICE
import { Injectable } from '@nestjs/common';
import * as Sentry from '@sentry/node';
import config from '../../config';
import { SentryEntry } from './sentry.interceptor';
@Injectable()
export class SentryService {
private isInit = false;