Skip to content

Instantly share code, notes, and snippets.

View ADelRosarioH's full-sized avatar
:octocat:
I may be slow to respond.

Anthony Del Rosario ADelRosarioH

:octocat:
I may be slow to respond.
View GitHub Profile
@ADelRosarioH
ADelRosarioH / SearchStack.ts
Created September 6, 2024 17:09
Typesense Provisioning using AWS CDK, ECS, EFS, ALB wth CloudFront Proxy
import { StackContext } from "sst/constructs";
import * as ec2 from "aws-cdk-lib/aws-ec2";
import * as ecs from "aws-cdk-lib/aws-ecs";
import * as elbv2 from "aws-cdk-lib/aws-elasticloadbalancingv2";
import * as efs from "aws-cdk-lib/aws-efs";
import * as iam from "aws-cdk-lib/aws-iam";
import * as cloudfront from "aws-cdk-lib/aws-cloudfront";
import * as origins from "aws-cdk-lib/aws-cloudfront-origins";
import { RemovalPolicy, Duration } from "aws-cdk-lib";
import { nanoid } from "nanoid";
@ADelRosarioH
ADelRosarioH / Non2xxHttpStatusCode.cs
Last active December 1, 2021 16:02
Non 2xx Http Status Codes for C# Unit Tests using MTests
[DataRow(HttpStatusCode.Ambiguous)]
[DataRow(HttpStatusCode.MultipleChoices)]
[DataRow(HttpStatusCode.Moved)]
[DataRow(HttpStatusCode.MovedPermanently)]
[DataRow(HttpStatusCode.Found)]
[DataRow(HttpStatusCode.Redirect)]
[DataRow(HttpStatusCode.RedirectMethod)]
[DataRow(HttpStatusCode.SeeOther)]
[DataRow(HttpStatusCode.NotModified)]
[DataRow(HttpStatusCode.UseProxy)]
@ADelRosarioH
ADelRosarioH / merger.py
Created October 28, 2021 23:47
combine, join or merge a list of excel (xlsx) files into a csv
import glob
import pandas as pd
workbooks = glob.glob('*.xlsx')
result_df = pd.DataFrame()
for wb in workbooks:
xlsx = pd.read_excel(wb, engine='openpyxl')
result_df = pd.concat([result_df, xlsx])
@ADelRosarioH
ADelRosarioH / enqueuer.py
Last active July 27, 2021 02:50
List AWS S3 objects and enqueue them into an AWS SQS
import sys
import json
import argparse
import boto3
parser = argparse.ArgumentParser("enqueue S3 objects into SQS")
parser.add_argument('bucket_name')
parser.add_argument('prefix')
parser.add_argument('postfix')
@ADelRosarioH
ADelRosarioH / .npmrc
Created September 3, 2018 15:28 — forked from ikaruce/.npmrc
.npmrc( proxy and strict-ssl setting )
proxy http://{proxy_server}:{proxy_port}
https-proxy http://{proxy_server}:{proxy_port}
strict-ssl=false
function toggleClass(elemenet, className){
var classList = elemenet.className.split(' ');
var indexOfClassName = classList.indexOf(className);
if(indexOfClassName > -1) classList.splice(indexOfClassName, 1);
else classList.push(className);
elemenet.className = classList instanceof Array ? classList.join(' ') : classList;
}
@ADelRosarioH
ADelRosarioH / GetAllPRofiles.java
Last active January 12, 2017 18:41
Select all profiles that have access to an sobject in salesforce
List<ObjectPermissions> permissionSetAssignmentIds = [SELECT ParentId
FROM ObjectPermissions
WHERE
PermissionsCreate = True AND
PermissionsRead = True AND
PermissionsEdit = True AND
PermissionsDelete = False AND
PermissionsViewAllRecords = False AND
PermissionsModifyAllRecords = False AND
function stepsToPosition(a, b){
var limit = 1000;
var steps = 0;
var o = {};
var x = 0, y = 0;
var moves = 3;
for(var i = 0; i < limit; i++) {
var r = (x < a) ? (x + 2 < a ? 2 : 1) : 1;
``THE ROBOT AND THE BABY''
A story by John McCarthy
``Mistress, your baby is doing poorly. He needs your attention.''
``Stop bothering me, you fucking robot.''
``Mistress, the baby won't eat. If he doesn't get some human love, the Internet pediatrics book says he will die.''
``Love the fucking baby, yourself.''
@ADelRosarioH
ADelRosarioH / Transverser.apxc
Created May 12, 2016 14:59
Takes a list object and apply the specified filters and returns a result
public class Transverser {
private String rawJson;
private Object parsedJson;
private final String PATH_TOKEN = '/';
private final String FILTER_START_TOKEN = '[';
private final String FILTER_END_TOKEN = ']';
private final String COMBO_START_TOKEN = '(';
private final String COMBO_END_TOKEN = ')';