convert SSL certificate to PEM / PFX

# put these files in a folder:
# key private.key
# certificate.crt
# certfile ca-bundle.crt

# If openssl is not install, install it:
# winget install --id ShiningLight.OpenSSL.Light -e
# add its path to PATH

# Convert to PFX
openssl pkcs12 -export `
    -out wildcard.pfx `
    -inkey private.key `
    -in certificate.crt `
    -certfile ca-bundle.crt `
    -name "Wildcard SSL Certificate"
    
# Convert to PEM
$files = @(
    "certificate.crt",
    "ca-bundle.crt",
    "pr

Install all dependencies from requirements.txt

python -m pip install -r requirements.txt

Create Django Secret Key

# Pure Python, not through Django
python -c "import secrets; print(secrets.token_urlsafe(50))"

# Using Django
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"


1882. Process Tasks Using Servers

You are given two 0-indexed integer arrays servers and tasks of lengths n​​​​​​ and m​​​​​​ respectively. servers[i] is the weight of the i​​​​​​th​​​​ server, and tasks[j] is the time needed to process the j​​​​​​th​​​​ task in seconds. Tasks are assigned to the servers using a task queue. Initially, all servers are free, and the queue is empty. At second j, the jth task is inserted into the queue (starting with the 0th task being inserted at second 0). As long as there are free servers and the queue is not empty, the task in the front of the queue will be assigned to a free server with the smallest weight, and in case of a tie, it is assigned to a free server with the smallest index. If there are no free servers and the queue is not empty, we wait until a server becomes free and immediately assign the next task. If multiple servers become free at the same time, then multiple tasks from the queue will be assigned in order of insertion following the weight and index priorities above. A server that is assigned task j at second t will be free again at second t + tasks[j]. Build an array ans​​​​ of length m, where ans[j] is the index of the server the j​​​​​​th task will be assigned to. Return the array ans​​​​.
/**
 * @param {number[]} servers
 * @param {number[]} tasks
 * @return {number[]}
 */
var assignTasks = function(servers, tasks) {
    const free = [];
    const busy = [];

    // Min-heap helpers. Each heap uses its own comparison rule.
    function push(heap, value, compare) {
        heap.push(value);
        let i = heap.length - 1;

        while (i > 0) {
            const parent = Math.floor((i - 1) / 2);
            if (compare(heap[parent], heap[i]) <= 0) break;
            [heap[paren

copy / backup and restore postgres database

# Make sure pg_dump in installed, if not - install from here: https://www.postgresql.org/download/

# copy
pg_dump -Fc -v `
  -d "SOURCE_RAILWAY_PUBLIC_URL" `
  -f "railway_backup.dump"
  
# restore  
pg_restore -v --no-owner --no-acl `
  -d "DESTINATION_RAILWAY_PUBLIC_URL" `
  railway_backup.dump

Configuration ademe-raw-v7

{
  // Cette capture décrit l'instance, pas le schéma SQL ni toute la configuration AWS.
  // null = valeur absente ou masquée dans la capture, pas nécessairement inexistante.
  "source": "Capture de la console AWS RDS fournie par l'utilisateur",
  "instance": {
    "service": "Amazon RDS",
    "engine": "PostgreSQL",
    "engine_version": "16.13",
    "db_instance_id": "ademe-raw-v7",
    // Région et compte extraits de l'ARN ci-dessous.
    "aws_region": "eu-west-3",
    "aws_account_id": "001

2747. Count Zero Request Servers

You are given an integer n denoting the total number of servers and a 2D 0-indexed integer array logs, where logs[i] = [server_id, time] denotes that the server with id server_id received a request at time time. You are also given an integer x and a 0-indexed integer array queries. Return a 0-indexed integer array arr of length queries.length where arr[i] represents the number of servers that did not receive any requests during the time interval [queries[i] - x, queries[i]]. Note that the time intervals are inclusive.
/**
 * @param {number} n
 * @param {number[][]} logs
 * @param {number} x
 * @param {number[]} queries
 * @return {number[]}
 */
var countServers = function(n, logs, x, queries) {
    logs.sort((a, b) => a[1] - b[1]);

    // Keep each query's original index so results return in input order.
    const orderedQueries = queries
        .map((time, index) => [time, index])
        .sort((a, b) => a[0] - b[0]);

    const answers = new Array(queries.length);
    const requestCount = new Array(n + 1)

OSに干渉するCSS

//OSのメニューバーエリアがある場合に余白を確保
footer{
 padding-bottom: env(safe-area-inset-bottom,0);
}

General_Listening_Practice_Set_1_Test_5.pdf

Williams
43
1994
primrose
05482
A
C
C
B
B
3
4
7
2
1
10
rooftop bar
hotel manager
coffebar lounge
by the pool

supermarket building
operation
protection building
road access
A
D

A
B
China
Trading routes
tax
alchohol
6%
Russia
India
moisture
cells
auctions

ultrasound 
roof of the mouth (top) bottom of the mouth
palate - der Gaumen

1385. Find the Distance Value Between Two Arrays

Given two integer arrays arr1 and arr2, and the integer d, return the distance value between the two arrays. The distance value is defined as the number of elements arr1[i] such that there is not any element arr2[j] where |arr1[i]-arr2[j]| <= d.
/**
 * @param {number[]} arr1
 * @param {number[]} arr2
 * @param {number} d
 * @return {number}
 */
var findTheDistanceValue = function(arr1, arr2, d) {
    let count = 0;

    for (const x of arr1) {
        // Keep x only if no value in arr2 is within distance d.
        const isFarFromAll = arr2.every(y => Math.abs(x - y) > d);

        if (isFarFromAll) {
            count++;
        }
    }

    return count;
};

Score intervals for optional checklist responses

# Keep skipped checklist answers uncertain This small JavaScript function returns a score interval for a checklist whose score is the total number of items minus the number marked yes. It accepts only aggregate counts. It never needs the questions, the respondent's identity, or individual answers. For example, 28 known yes answers and 7 skipped items on a 100-item checklist give an interval of **65 to 72**. Treating every skipped answer as no would show only the upper end and hide the uncertainty. The function returns an exact value only when `skipped` is zero. ```js import { scoreInterval } from './score-interval.js'; scoreInterval({ yes: 28, skipped: 7 }); // { lower: 65, upper: 72, isExact: false, answered: 93, total: 100 } ``` Check the scoring convention before reusing this function. It fits a fixed-length reverse-count checklist; it does not compute a percentile, diagnose a condition, or measure someone's character. Two people can have the same number from different answers. An example of the surrounding interface problem is [Rice Purity HQ](https://ricepurityhq.com/), an adult experience checklist with optional skipping. This snippet is an independent illustration of handling missing answers, not the site's production source. An interface can display the interval beside the number of skipped items and keep all processing in the browser. For presentation, use `lower === upper` to show one number, otherwise show both bounds. Do not put answers or totals into a URL just to let someone share the page: a plain page link can remain separate from a person's responses. The code rejects negative counts, fractions, unsafe integers, zero totals, and counts that exceed the total. No dependencies are required.
/**
 * Bound a reverse-count checklist score without guessing skipped answers.
 * The function consumes totals, never the wording or identity of an answer.
 * For a 100-item checklist, total = 100 and final score = 100 - yes.
 */
export function scoreInterval({ yes, skipped, total = 100 } = {}) {
  for (const [name, value] of Object.entries({ yes, skipped, total })) {
    if (!Number.isSafeInteger(value) || value < 0) {
      throw new TypeError(`${name} must be a nonnegative safe integer`);
   

General_Writing_Practice_Set1_Test_4.pdf

Task 1
Dear Mike,

I'm writting you because I finally decided to take a trip to Italy and I'd really like you to come with me. It is from 15th to 24th of November. The flight tickets cost around 200 euro for the return journey and accomidation costs are around 700 euro in total. I'm going to spend roughly 600 euro for entertainment, including sightseeing, eating out and public transport costs.

This time I want to explore the Island of Sicily and visit its capital city Palermo, the historical ru

cos'è un Gist

La variante più semplice di ciò che offre GitHub è un Gist. Ti fai un account, carichi del codice funzionante (o una ricetta di una torta, o un'idea per un film, qualsiasi documento di testo singolo), e ora è disponibile online. Di solito, se sei tu a pubblicare il Gist, è specifico per te: il mondo non ha bisogno di un altro Java Hello World, ma potrebbe essere utile avere accesso alla tua configurazione IDE personalizzata.

Quindi il livello uno sono file di testo, disponibili online, legati a

Rails Redis

### Quick Review of Rails - Redis
---
* Redis `$redis` is set in an initializer file
* Must ensure to select the correct indice from the redis databse
  * For example:
  ```
  redis_key = "some_key"
  cache = RedisCache::Hash.new($redis, redis_key, 2) 
  # 2 = indice you are querying data from
  
  # May need to log in and out of redis server
  # hscan allows you to search the database without blocking production access
  $redis.hscan_each(redis_key).to_a
  # return the keys in an array
  
  # S

3505. Minimum Operations to Make Elements Within K Subarrays Equal

You are given an integer array nums and two integers, x and k. You can perform the following operation any number of times (including zero): Increase or decrease any element of nums by 1. Return the minimum number of operations needed to have at least k non-overlapping subarrays of size exactly x in nums, where all elements within each subarray are equal.
/**
 * @param {number[]} nums
 * @param {number} x
 * @param {number} k
 * @return {number}
 */
var minOperations = function(nums, x, k) {
    const n = nums.length;

    // Fenwick tree supporting point updates, prefix sums, and kth-element lookup.
    class Fenwick {
        constructor(size) {
            this.tree = new Array(size + 1).fill(0);
        }

        add(index, delta) {
            for (let i = index; i < this.tree.length; i += i & -i) {
                this.tree[i] += delta;
  

Generate published fee report

Generate a report of published courses with there published singular fees and tuition fee text as well as whether they have been overridden.
select
    concat('php artisan fees:update --course_id=',courses.id, ' ',instances.year,' --nomail'),
    courses.id as ProID,
    instances.acad_period as `Acad period`,
    case 
        when courses.level_id = 1 then 'UG'
        when courses.level_id = 2 then 'PG'
    end as Level,
    concat(awards.name,' ',courses.title) as Title,

    case
        when
            nullif(json_unquote(json_extract(tuition_fees.fees, '$.foundation_home_fee')), 'null') is not null
            or nullif(json_