Do anyone has experience with selling e-books? Can you show me the way

I need advices on the topic above. I have created an e-book in a topic I know. It's a programming workbook. Now I need to sell it. I have already created a landing page, and integrated Paddle checkout. I'm thinking about doing Instagram ads. What are other ways to make sales from digital books?

reddit.com
u/outer_gamer — 13 hours ago

I built a Telegram bot for channel admins

I’ve run an English-language channel for 5+ years. In the early days I’d spend an hour every day curating content, organizing posts, and trying not to bore my audience — it was my thing.

Over time work and life got busier and finding the time became hard. Hunting for old posts to reshared took ages, and I started missing days, then weeks. The channel grew to 600+ subscribers and I didn’t want it to die, but I didn’t have 30–60 minutes a day to spare.

So I built a small helper bot to do the tedious part: it helps to find older posts and repost them so the channel stays active. It supports multiple channels and three languages. I run two of my channels with it now, and keeping them going feels like fun again instead of a chore.

I think it’s especially useful for education-focused channels (language teaching, psychology, that sort of thing). Would something like this be useful to you? Any thoughts or ideas on improvements?

reddit.com
u/outer_gamer — 11 days ago

I think this belongs to here

I made flashback edit of ATLA characters in TLOK 4 years ago. These flashbacks were precious to me because I got the chance to look at my beloved characters.

drive.google.com
u/outer_gamer — 16 days ago
▲ 0 r/PHP

Can we write a clean, functional multi-column sorter payload without using framework collections? Here is a breakdown.

Hey r/php,

I’ve spent a lot of time mentoring developers who are incredibly comfortable inside modern frameworks (like Laravel or Symfony), but they frequently hit a wall when they need to drop down to raw, native PHP mechanics to handle variable multi-layer logic.

A classic example is dynamic, multi-column dashboard sorting where the priority order, target keys, and sorting directions are determined at runtime by an incoming API payload. Framework collection helpers abstract this away, but handling it purely with native usort() using a fallback closure cascade is a great mental exercise in core data manipulation.

I'm working on a set of progressive logic problems called Linear Code Mastery, and I wanted to share Task #54 to see how you all would approach or optimize this specific engineering pattern.


The Problem: The Dynamic Multi-Column Sorter

The Scenario: An order management dashboard allows operators to sort an order queue by multiple columns simultaneously — for example: sort by status ascending, then by total_amount descending, then by created_at ascending as a tiebreaker. The number of sort columns and their directions are submitted as a runtime configuration array, not hardcoded.

The Requirements & Constraints:

  • Accepts a flat tabular dataset array and an ordered $sortSpec array detailing columns and string directions ('asc' or 'desc').
  • Must use native usort() with a dynamically constructed closure comparator — no helper collections, no array_multisort().
  • The comparator must evaluate each column in priority order via a "waterfall" loop, returning immediately if a non-zero tiebreaker is found, and continuing if there is a tie.
  • String columns use strcmp(). Numeric columns use the spaceship operator <=>.
  • Missing keys in records should gracefully default to an empty string fallback without triggering undefined array index errors.
  • Direction inversion (desc) must be handled clean and line-linearly without messy branching logic.

The Structural Architecture

  1. Isolation: Operate on a shallow copy of the dataset array within the wrapper method to respect execution safety and prevent mutating the caller's reference pointer.
  2. The Priority Cascade: The closure built inside buildComparator() iterates directly through the runtime specifications. If a comparison yields a non-zero integer, that direction-adjusted value is popped back to usort() immediately.
  3. Type Uniformity: String vs numeric checking uses is_numeric(), casting numeric targets to unified floats to keep string-integers and string-floats evaluating perfectly on the spaceship axis.

The Code Implementation

<?php declare(strict_types=1);

/**
 * DynamicMultiColumnSorter
 *
 * Sorts tabular datasets by a runtime-configured multi-column sort specification.
 * Builds a single usort() comparator that evaluates columns in priority order,
 * falling through to the next column on ties.
 */
final class DynamicMultiColumnSorter
{
    /**
     * Sorts a dataset by a multi-column sort specification.
     * Operates on a copy of $dataset — returns a re-indexed array.
     */
    public function sort(array $dataset, array $sortSpec): array
    {
        if ($dataset === [] || $sortSpec === []) {
            return array_values($dataset);
        }

        $data = $dataset;
        $comparator = $this->buildComparator($sortSpec);
        usort($data, $comparator);

        return $data;
    }

    /**
     * Builds a multi-column comparator closure from the sort specification.
     */
    private function buildComparator(array $sortSpec): \Closure
    {
        return function (array $a, array $b) use ($sortSpec): int {

            foreach ($sortSpec as $spec) {
                $column    = $spec['column'];
                $direction = strtolower($spec['direction']) === 'desc' ? 'desc' : 'asc';

                // Null-coalescing to empty string for missing columns
                $valA = $a[$column] ?? '';
                $valB = $b[$column] ?? '';

                // Auto-detect comparison method: numeric vs string
                if (is_numeric($valA) && is_numeric($valB)) {
                    $result = (float) $valA <=> (float) $valB;
                } else {
                    $result = strcmp((string) $valA, (string) $valB);
                    $result = $result === 0 ? 0 : ($result < 0 ? -1 : 1);
                }

                if ($result !== 0) {
                    return $direction === 'desc' ? -$result : $result;
                }
            }

            return 0;
        };
    }
}

Let's Discuss

How do you tackle clean dynamic user-sorting inside native PHP core environments when you can't touch heavy external collections libraries? Would you handle the closure compilation or the type evaluation differently here?

I'd love to see alternative micro-optimizations or different approaches to handling the tiebreaker loop in the comments!


Note: If you enjoy working through these types of raw array manipulations and language mechanics, I put together the full set of 100 progressive logic challenges in my workbook project workspace, Linear Code Mastery.


u/outer_gamer — 25 days ago

I have create a digital footprint cleaner for Telegram and don't know what to do with it

Recently, I have heard about people being fined or arrested for sharing things on social media. For example, this guy shared a restricted person's content in a Telegram group 3 years ago, but he was sentenced still. Such situations inspired me to create a CLI tool called NoTrace.

It is destructive tool that can delete your messages from bots, 1:1 chats, groups and groups linked to channels. It has 4 levels of deletion, in 1st level you can delete any number of your messages from any chat. 4th level will clear your all messages from that chat, and local cache too, so that it will look like you never had that chat at all (it will be deleted from Telegram servers too). If you had messages from 5 years earlier in a chat, the app will find and delete it for you.

There is blocklist purging option, someone being on your blocklist means, in the past you chatted with him. So cleaning blocklist is a way of cleaning digital trace.

There is useless contacts purging option, it will remove the contacts on your Telegram that you didn't start a chat with. If that person wasn't important enough for you to start a conversation, then he wasn't important.

As a Telegram user would you ever use (or buy) such app? Do you think this app has value?

reddit.com
u/outer_gamer — 2 months ago