Skip to content

Instantly share code, notes, and snippets.

View ceelsoin's full-sized avatar
🏠
Working from home

Celso Inácio ceelsoin

🏠
Working from home
View GitHub Profile
@ceelsoin
ceelsoin / Signature.ts
Created July 5, 2023 01:20
Bunny TUS Upload Signature Typescript
require("dotenv").config();
const crypto = require("crypto");
private getAPIKey(): string {
return process.env.BUNNY_STREAM_API_KEY
}
private getSignature(library_id, video_id, expiration_time = 86400) {
//https://docs.bunny.net/reference/tus-resumable-uploads
const expires = Math.floor(new Date() as any / 1000) + expiration_time;
@ceelsoin
ceelsoin / README.md
Created May 15, 2023 19:49
Docker MailServer + Round Cube (easy install)

Setup Docker MailServer + Round Cube (easy install)

1. Create docker-compose.yml (content below) and up

$ docker-compose up -d

2. Download setup script

@ceelsoin
ceelsoin / iugu.service.ts
Created August 5, 2022 15:21
Iugu service
import { inject, injectable } from "inversify";
import { ICustomerModel } from "../../Infra/Models/Customer.model";
import log, { LogLevelEnum } from "../Utils/logger.util";
require("dotenv").config();
const axios = require("axios").default;
export interface IIuguService {
getCustomers(): Promise<any>
getCustomerById(id: any): Promise<any>
@ceelsoin
ceelsoin / a-mongodb-replica-set-docker-compose-readme.md
Created July 29, 2022 16:58 — forked from harveyconnor/a-mongodb-replica-set-docker-compose-readme.md
MongoDB Replica Set / docker-compose / mongoose transaction with persistent volume

This will guide you through setting up a replica set in a docker environment using.

  • Docker Compose
  • MongoDB Replica Sets
  • Mongoose
  • Mongoose Transactions

Thanks to https://gist.github.com/asoorm for helping with their docker-compose file!

Setup:

Add before end of body in your public/index.html

    <script type="text/javascript" src="https://js.iugu.com/v2"></script>

Using example:

@ceelsoin
ceelsoin / DynamicControllerImport.util.ts
Created December 31, 2021 17:26
Dynamic controller import inversify-express-utils
const path = require('path');
const loadHandlers = () => {
return new Promise(async (resolve, reject) => {
const fs = require('fs');
const dir = path.join(process.cwd(), process.env.NODE_ENV != 'production' ? 'src' : '','/Presentation/Handlers')
log(LogLevelEnum.INFO, `Loading controllers from ${dir}`)
await fs.readdir(dir, async (err, files) => {
let reducers = files.filter(a => a.includes('.'));
public async getKeycloakUserByEmail(email: String): Promise<any> {
const config = {
headers: {
Authorization: 'Bearer '+ await this.getApplicationServiceToken(),
}
};
return axios.get(`${this.BASE_URL}/auth/admin/realms/shallwe/users?email=${email}`, config)
}
@ceelsoin
ceelsoin / README.md
Created January 5, 2021 17:03
Remove chrome autofill blue background css trick

Autofill remove css trick

  • Just add this css on your form page.

(All forms cotinue autofilling, this css just remove blue background)

@ceelsoin
ceelsoin / android_instructions.md
Created November 3, 2020 18:10 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@ceelsoin
ceelsoin / index.js
Created August 24, 2020 14:59 — forked from akexorcist/index.js
Axios post method requesting with x-www-form-urlencoded content type
const axios = require('axios')
const qs = require('querystring')
...
const requestBody = {
name: 'Akexorcist',
age: '28',
position: 'Android Developer',
description: 'birthdate=25-12-1989&favourite=coding%20coding%20and%20coding&company=Nextzy%20Technologies&website=http://www.akexorcist.com/',