Skip to content

Instantly share code, notes, and snippets.

View mattbajorek's full-sized avatar

Matt Bajorek mattbajorek

View GitHub Profile
@mattbajorek
mattbajorek / account.entity.ts
Last active September 5, 2021 00:02
Final account entity with balance column
import { Transform } from 'class-transformer';
import { Column, Entity } from 'typeorm';
import { DecimalToString, DecimalTransformer } from './decimal.transformer';
@Entity('account')
export class AccountEntity {
@Column({ name: 'balance', type: 'decimal', precision: 10, scale: 2, default: 0.0, transformer: new DecimalTransformer() })
@Transform(DecimalToString(), { toPlainOnly: true })
public balance: Decimal;
}
@mattbajorek
mattbajorek / decimal.transformer.ts
Created September 4, 2021 23:59
Class transformer decimal object to JSON
export const DecimalToString = (decimals: number = 2) => (decimal?: Decimal) => decimal?.toFixed?.(decimals) || decimal;
@mattbajorek
mattbajorek / account.entity.ts
Last active September 5, 2021 00:01
Account balance with decimal transformer
import { Column, Entity } from 'typeorm';
import { DecimalTransformer } from './decimal.transformer';
@Entity('account')
export class AccountEntity {
@Column({ name: 'balance', type: 'decimal', precision: 10, scale: 2, default: 0.0, transformer: new DecimalTransformer() })
public balance: Decimal;
}
@mattbajorek
mattbajorek / decimal.transformer.ts
Last active April 11, 2023 18:37
Decimal transformer for typeorm
import Decimal from 'decimal.js';
import { ValueTransformer } from 'typeorm';
export class DecimalTransformer implements ValueTransformer {
/**
* Used to marshal Decimal when writing to the database.
*/
to(decimal?: Decimal): string | null {
return decimal?.toString();
}
@mattbajorek
mattbajorek / account.entity.ts
Last active September 4, 2021 23:58
Initial balance decimal
import { Column, Entity } from 'typeorm';
@Entity('account')
export class AccountEntity {
@Column({ name: 'balance', type: 'decimal', precision: 10, scale: 2, default: 0.0 })
public balance: string;
}
@mattbajorek
mattbajorek / recovered_emails.txt
Created June 13, 2020 19:22
Recovered emails by hashcat
a295fa4e457ca8c72751ffb6196f34b2349dcd91443b8c70ad76082d30dbdcd9:[email protected]
eb128495afd6bb3b92af2769be621cae85cfe8364ddedec4f791d73c048bb54b:[email protected]
9a87cd73e0ca53800a5f3f1ae9ce200c59fd2207be54dfe5e0a0874c003e8155:[email protected]
@mattbajorek
mattbajorek / hashed_emails.txt
Created June 13, 2020 18:15
sha256 email hashes needed to be recovered
a295fa4e457ca8c72751ffb6196f34b2349dcd91443b8c70ad76082d30dbdcd9
eb128495afd6bb3b92af2769be621cae85cfe8364ddedec4f791d73c048bb54b
9a87cd73e0ca53800a5f3f1ae9ce200c59fd2207be54dfe5e0a0874c003e8155
@mattbajorek
mattbajorek / email.hcmask
Created June 13, 2020 17:08
Email hash masks for hashcat
?l?d,?l?d._-,[email protected]
?l?d,?l?d._-,[email protected]
?l?d,?l?d._-,[email protected]
?l?d,?l?d._-,[email protected]
?l?d,?l?d._-,[email protected]
?l?d,?l?d._-,[email protected]
?l?d,?l?d._-,[email protected]
?l?d,?l?d._-,[email protected]
?l?d,?l?d._-,[email protected]
?l?d,?l?d._-,[email protected]
@mattbajorek
mattbajorek / BuildPostProcessor.cs
Created April 13, 2020 00:12
Copy edited Objective C folders and files back to Unity
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using System.IO;
using System.Linq;
public class BuildPostProcessor
{
[PostProcessBuild]
@mattbajorek
mattbajorek / CallingExample.cs
Created April 12, 2020 22:16
Example calling script
using System;
using Plugins.NativeCalculations;
using UnityEngine;
public class CallingExample : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
try