Skip to content

Instantly share code, notes, and snippets.

View treffiletti's full-sized avatar

Nick (Nicholas) Treffiletti treffiletti

View GitHub Profile
@treffiletti
treffiletti / Save GPTs
Created February 4, 2025 16:24
Save Chat GPTs
set linkList to {"https://chatgpt.com/c/<YOUR CHAT ID>", "https://chatgpt.com/c/<YOUR CHAT ID>"}
tell application "Google Chrome"
activate -- Bring Chrome to the foreground
repeat with currentLink in linkList
-- Open the link in Chrome
open location currentLink
delay 5 -- Adjust delay for page load time if necessary
@treffiletti
treffiletti / MacToWindowsAppSwitcher.json
Last active November 26, 2024 17:28
Karabiner Map Command Tab to Alt Tab for VMWare Horizon
{
"description": "WORKING - VMware Horizon Client - Remap Command + Tab to Alt + Tab - Must map Command Key to Alt Key inside of VMWare Horizon Settings",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
@treffiletti
treffiletti / ApiModule.ts
Created August 23, 2022 20:26
Nest Basic Crud Code for wrapping a public API
// plaid.service.ts
@Injectable()
export default class PlaidService {
private plaid: Plaid;
constructor(
private configService: ConfigService
) {
this.plaid = new Plaid(configService.get('SOME CONFIGS'));
}
@treffiletti
treffiletti / secrets.service.ts
Last active July 26, 2022 04:58
Aws Secrets Service #NestJS #AWS
import { Injectable } from '@nestjs/common'
import { SecretsManager, ListSecretsCommandInput, Tag } from '@aws-sdk/client-secrets-manager'
import { AwsService } from '../aws.service'
import { camelCase, constantCase } from 'change-case'
// import { sendRequest } from '../../../helpers/request'
// import { BadRequestAssertion } from '../../../shared/assertions'
@Injectable()
export class AwsSecretsService extends AwsService {
environment: string
@treffiletti
treffiletti / AwsSecretsClient.ts
Created July 26, 2022 04:56
AWS Secrets Client Class #NestJS #AWS
import { SecretsManager, ListSecretsCommandInput } from '@aws-sdk/client-secrets-manager'
interface SecretListParams {
environment: string
listParams: ListSecretsCommandInput
}
class SecretManager {
environment: string
client: SecretsManager
@treffiletti
treffiletti / awsConfig.service.ts
Created July 26, 2022 03:45
AWS Secrets Config #NestJS #AWS
import { Injectable, Logger } from '@nestjs/common'
import * as dotenv from 'dotenv'
import * as AWS from 'aws-sdk'
@Injectable()
export class ConfigService {
private readonly envConfig: Record<string, string>
private readAWSConfig: boolean
private region = ''
private secretName = ''
@treffiletti
treffiletti / config.service.ts
Created July 26, 2022 03:43
AWS Secrets Config
import { Injectable, Logger } from '@nestjs/common'
import * as dotenv from 'dotenv'
import * as AWS from 'aws-sdk'
@Injectable()
export class ConfigService {
private readonly envConfig: Record<string, string>
private readAWSConfig: boolean
private region = ''
private secretName = ''
@treffiletti
treffiletti / AlloyJourneyResponseSchema.json
Created July 15, 2022 23:16
AlloyJourneyResponseSchema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"self": {
"type": "object",
"properties": {
@treffiletti
treffiletti / typeorm-where.ts
Created April 20, 2022 07:06
How to query with #NestJS #typeORM #MySql
// in your controller:
rewardsledger.findAll(query);
// in your service:
const qb = await getRepository(RewardLedgerEntity).createQueryBuilder(
"RewardLedger"
);
if ("start_date" in query) {
{
"files.associations": {
".env": "shellscript",
"*.js": "javascriptreact",
"*.liquid": "liquid"
},
"workbench.panel.defaultLocation": "right",
"editor.minimap.enabled": false,
"debug.console.wordWrap": false,
"workbench.startupEditor": "none",