Skip to content

Instantly share code, notes, and snippets.

View Hobart2967's full-sized avatar
๐Ÿš€
Eat. Sleep. Code. Repeat.

Marco Klein Hobart2967

๐Ÿš€
Eat. Sleep. Code. Repeat.
View GitHub Profile
import { MyState } from 'my-state.enum';
import { translations } from 'translations.de';
const state: MyState = getState();
assert(translations[state]);
console.log(`Status: ${translations[state]}`);
Model Information:
* title: Viking Watch Tower
* source: https://sketchfab.com/3d-models/viking-watch-tower-5cd42c3ef75748e0b57f25247f073d53
* author: eugeen (https://sketchfab.com/eugeen)
Model License:
* license type: CC-BY-NC-4.0 (http://creativecommons.org/licenses/by-nc/4.0/)
* requirements: Author must be credited. No commercial use.
If you use this 3D model in your project be sure to copy paste this credit wherever you share it:
docker-dev-db-1 | The files belonging to this database system will be owned by user "postgres".
docker-dev-db-1 | This user must also own the server process.
docker-dev-db-1 |
docker-dev-db-1 |
docker-dev-db-1 | The database cluster will be initialized with locale "en_US.utf8".
docker-dev-db-1 | The default database encoding has accordingly been set to "UTF8".
docker-dev-db-1 | The default text search configuration will be set to "english".
docker-dev-db-1 |
docker-dev-db-1 |
docker-dev-db-1 | Data page checksums are disabled.
@Hobart2967
Hobart2967 / merge-repos.js
Last active November 2, 2022 11:47
Merging packages and repos into a new, single one.
/*
To use this script, adjust the `config` object.
- set owner
- set source repos to migrate from
- set target repository name
- set target repository folder path
IMPORTANT: .npmrc needs to be configured, being to access GitHub Packages.
Execute using:
export GITHUB_TOKEN=<personal_access_token>
export GITHUB_USER=<github_user_name>
@Hobart2967
Hobart2967 / gitmemory.sh
Last active April 4, 2022 13:26
gitmemory.sh
#!/bin/bash
GIT_MEMORY_CONFIG=~/.bash/resources/.gitmemory.json
alias oldcd=cd
reset-git-memory() {
rm -rf $GIT_MEMORY_CONFIG
}
export class AsyncObject<T> {
//#region Private Fields
private _valueSet: T = null as any;
private _resolveValue: (value: T | PromiseLike<T>) => void = null as any;
//#endregion
//#region Properties
private _value: Promise<T>;
public get value(): Promise<T> {
return this._value;
@Hobart2967
Hobart2967 / giti.sh
Created November 29, 2021 21:08
giti.sh
#!/bin/bash
giti() {
echo $1 >> .gitignore
}
@Hobart2967
Hobart2967 / jwt.cs
Created October 31, 2021 13:56
JwtGeneration .NET
using Avsn.Core.Accounting.Api.Contracts;
using Microsoft.Extensions.Options;
using Wyrekit.Core.Api.Composition.Abstraction;
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
@Hobart2967
Hobart2967 / convert-to-css-selector.js
Last active October 6, 2021 10:46
Quick and dirty fix for supporting XPath including shadow root.
function convertToCssSelector(xPath: string): string {
let selector = '';
let filterOpenedAt: boolean|number = false;
let squareBracketsOpened = 0;
for (let i = 0; i < xPath.length; i++) {
if (xPath[i] === '/') {
if (i === 0 || i === 1) {
continue;
}
@Hobart2967
Hobart2967 / excel4node.js
Created September 7, 2018 06:37
excel4node
module.exports = function(argsPassed) {
var excel = require('excel4node');
var path = require('path');
// Create a new instance of a Workbook class
var workbook = new excel.Workbook();
// Add Worksheets to the workbook
var worksheet = workbook.addWorksheet('Sheet 1');
var worksheet2 = workbook.addWorksheet('Sheet 2');