Skip to content

Instantly share code, notes, and snippets.

View opejovic's full-sized avatar
:octocat:
Work in progress

Ognjen opejovic

:octocat:
Work in progress
View GitHub Profile
Can I Remove MySQL Binary Log Yes, as long as the data is replicated to Slave server, it’s safe to remove the file. It’s recommend only remove MySQL Binary Log older than 1 month.
Besides, if Recovery of data is the main concern, it’s recommend to archive MySQL Binary Log.
There are several ways to remove or clean up MySQL Binary Log, it’s not recommend to clean up the file manually, manually means running the remove command.
Remove MySQL Binary Log with RESET MASTER Statement Reset Master statement is uses for new database start up during replication for Master and Slave server. This statement can be used to remove all Binary Log.
To clean up Binary Log on Master Server

For production:

  • Invoices for the current month will be generated on the 1st of that month, or any day after that if onboarding a new agency/agent.
  • Subscriptions will be valid until the last day of that month, unless suspended

For testing purposes:

  • Billing period is set to 5 minutes
  • Subscriptions expire from when the invoice is generated + 5 minutes
  • Cron jobs will run every minute
@opejovic
opejovic / iterm2.md
Created February 7, 2024 09:58 — forked from squarism/iterm2.md
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@opejovic
opejovic / csv_generation.php
Last active February 2, 2024 07:41
generating x amount of rows
Route::get('/sample-csv-generation/{numberOfRows}', function (Request $request, $numberOfRows) {
$faker = Faker\Factory::create();
$numberOfRows = (int) $numberOfRows;
// Define the headers for the CSV file
$headers = [
'Content-Type' => 'text/csv',
'Content-Disposition' => 'attachment; filename="filename.csv"',
];
@opejovic
opejovic / stripe.php
Created January 25, 2024 18:13 — forked from ScottDeLuzio/stripe.php
Add card to customer account in Stripe
<?php
// Function to add a new card for your customer.
function sd_process_add_customer_card(){
$redirect = false;
if ( isset( $_POST['action'] ) && $_POST['action'] == 'add_customer_card' && wp_verify_nonce( $_POST['stripe_nonce'], 'stripe-nonce' ) ){
if ( !isset( $_POST['card_number'] ) || !isset( $_POST['card_cvc'] ) || !isset( $_POST['card_exp_month'] ) || !isset( $_POST['card_exp_year'] ) ){
$redirect = add_query_arg( array(
'card' => 'not-created',
), $_POST['redirect'] );
@opejovic
opejovic / Outlook.md
Last active March 29, 2023 18:05
Microsoft Azure / Outlook Setup

Since you are connected to the Microsoft Services tenant as a standard user with restricted access, you cannot perform all the admin access. To perform administrative actions, you must have administrative access to the tenant.

For this purpose, you need to create your own tenant. When you create a new tenant, you by default become the Global Administrator of the new tenant to get all access in that tenant.

To create a new tenant, access https://azure.microsoft.com/en-us/free/ to create a free Azure account.

image

Once the new account is created, you should be able to see the new tenant (directory) as highlighted below:

Access Google API: oauth, calendar and gmail

Create a project

image

image

Enable the Google Calendar API and Gmail API

Now, within that project, you will need to enable APIs and services. image

@opejovic
opejovic / Response.php
Created October 19, 2021 09:29 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
<div class="min-h-screen mx-auto relative overflow-x-hidden">
<div class="container mx-auto max-w-6xl">
<header class="mt-6 px-6 xl:px-4">
<nav class="flex justify-between items-center text-white">
<div>
<svg viewBox="0 0 60 25" xmlns="http://www.w3.org/2000/svg" width="60" height="25" class="UserLogo variant--">
<title>Stripe logo</title>
<path fill="var(--userLogoColor, #FFFFFF)" d="M59.64 14.28h-8.06c.19 1.93 1.6 2.55 3.2 2.55 1.64 0 2.96-.37 4.05-.95v3.32a8.33 8.33 0 0 1-4.56 1.1c-4.01 0-6.83-2.5-6.83-7.48 0-4.19 2.39-7.52 6.3-7.52 3.92 0 5.96 3.28 5.96 7.5 0 .4-.04 1.26-.06 1.48zm-5.92-5.62c-1.03 0-2.17.73-2.17 2.58h4.25c0-1.85-1.07-2.58-2.08-2.58zM40.95 20.3c-1.44 0-2.32-.6-2.9-1.04l-.02 4.63-4.12.87V5.57h3.76l.08 1.02a4.7 4.7 0 0 1 3.23-1.29c2.9 0 5.62 2.6 5.62 7.4 0 5.23-2.7 7.6-5.65 7.6zM40 8.95c-.95 0-1.54.34-1.97.81l.02 6.12c.4.44.98.78 1.95.78 1.52 0 2.54-1.65 2.54-3.87 0-2.15-1.04-3.84-2.54-3.84zM28.24 5.57h4.13v14.44h-4.13V5.57zm0-4.7L32.37 0
<?php
namespace Unit;
use Tests\TestCase;
use taskbee\Models\Plan;
use taskbee\Models\User;
use taskbee\Models\Subscription;
use taskbee\Facades\AuthorizationCode;
use Illuminate\Support\Facades\Mail;