Skip to content

Instantly share code, notes, and snippets.

@lesstif
lesstif / .styleci.yml
Created December 13, 2017 04:17
styleci configuration file for laravel project
preset: laravel
disabled:
# - self_accessor
enabled:
- mb_str_functions
- no_homoglyph_names
- psr4
- non_printable_character
@ccurtin
ccurtin / braintree-upgrade-subscription.js
Last active December 7, 2023 08:51
Braintree API / node How to upgrade a MONTHLY subscription to YEARLY subscription. Rough example. Braintree does NOT automatically prorate user's monthly balance onto the yearly subscription so MUST refund the user's latest Transaction before cancelling current subscription and creating a new subscription.
// 1) Get the customer... required the get the payment method token
await braintreeGateway.customer.find(
billing_customer_id,
async (err, customer) => {
await braintreeGateway.subscription.find(
subscriptionId,
async (err, subscription) => {
if (err) {
res.status(400).json({
error_message: err && err.code
@Akhil-Suresh
Akhil-Suresh / postman_installation.md
Last active July 6, 2024 04:21
Installing Postman on Ubuntu/Debian

Installing Postman

Step 1

If any version of postman is installed we need to remove it

sudo rm -rf /opt/Postman

Step 2

@bengry
bengry / app.module.ts
Created December 26, 2019 07:32
Nest.js request context workaround
import { MiddlewareConsumer, Module, NestModule } from "@nestjs/common";
import { APP_INTERCEPTOR } from "@nestjs/core";
import { RequestContextMiddleware } from "./request-context/request-context.middleware";
import { RequestContextModule } from "./request-context/request-context.module";
@Module({
imports: [
ConfigModule.load(path.resolve(__dirname, "config", "**/!(*.d).{ts,js}")),
WebappUsersModule,
RequestContextModule,