Skip to content

Instantly share code, notes, and snippets.

@fumiya-kume
fumiya-kume / .cursorrules
Created January 11, 2025 14:26
.cursorrules in 2025/01/11
# .cursorrules
# Development Steps for CLI Application in Go
## 1. Overall Design
- Define the purpose and scope of the CLI application.
- Identify the target audience and their needs.
- Outline the main features and functionalities.
- Create a high-level architecture diagram.
- **Improve Specifications/Features:**
@vicenterusso
vicenterusso / postgres_slow_blocked_queries.md
Created May 30, 2022 12:19
PostgreSQL: Find slow, long-running, and Blocked Queries

PostgreSQL: Find slow, long-running, and Blocked Queries

For active queries, PostgreSQL has a "statistics collector" subsystem that collates data on table, server, query, index, and connection activity. The database exposes information through a number of "pg_stat" predefined views and some lower-level statistic functions for power users.

Additionally, there are several system information functions that can extract session and system information on processes and queries that are currently ongoing.

The key tables and functions that I've found useful are:

  • pg_stat_activity: A table with one entry per server process, showing details of the running query for each.

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active January 15, 2025 11:36
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@xinha-sh
xinha-sh / client.ts
Last active January 15, 2025 11:35
Expo auth implementation using SST Auth V2
import type { StandardSchemaV1 } from "@standard-schema/spec";
import { type JSONWebKeySet, createLocalJWKSet, errors, jwtVerify } from "jose";
import {
InvalidAuthorizationCodeError,
InvalidRefreshTokenError,
InvalidSessionError,
} from "./error";
import { generatePKCE } from "./pkce";
import type { SubjectSchema } from "./session";
@SoaringGecko
SoaringGecko / README.md
Last active January 15, 2025 11:31
increase video volume past the normal maximum

based off of the following code https://stackoverflow.com/a/43794379/11006719 this edited version fixes the issue that would only let you use increase the volume on one video element every time the url is changed (The Firefox versions run when you click the page do to Firefox requiring the user to interact with the page before it allows you to create an AudioContext).

The versions with safety in the name (and the userscripts) will prompt you to confirm your input when you set it so high.

Chromium Bookmarklet (safety on)

Chromium Bookmarklet

Firefox Bookmarklet (safety on)

Conf File
Conf file or configuration file is the most important file in Odoo. It is used to set the initial parameters to run the Odoo.
Parameters:-
addons_path: defines the addons path folders, which are added in priority order.
admin_passwd: Names the Master password, which can also be changed from the front end. The master password for Odoo will be hashed and saved in the conf file when it is set or modified.
csv_internal_sep: Specifies the separator to use in the CSV file.
data_dir: specifies the path to the directory containing the filestore for data linked to Odoo.
db_host: Specifies the database host. Localhost is set by default.
db_maxconn: specifies the maximum number of PostgreSQL physical connections.

I've recently joined Amazon Dublin from India and got opportunities to interview with Meta London, Zalando Berlin & some other companies. I extensively researched about companies hiring internationally which support visa & relocation for Tech roles. So sharing list of companies:

Do consider to STAR, if it helped you.

London

@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active January 15, 2025 11:27
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@nufeng1999
nufeng1999 / InstallWSA.md
Last active January 15, 2025 11:26
[安装 Windows Subsystem for Android™️ ] 安装 Windows Subsystem for Android™️

1.获得 WAS 微软商店链接地址

https://www.microsoft.com/store/productId/9P3395VX91NR

2.下载 WAS 安装包

安装包抓包网址
https://store.rg-adguard.net/ 在这里输入上述商店链接,右边要选择Slow通道
(共有四个选项,分别是Fast,Slow,RP和Retail,分别对应Windows的Dev渠道,Beta渠道,RP渠道和正式版,目前只有Beta版本有发布)
找到最下面名为
"MicrosoftCorporationII.WindowsSubsystemForAndroid_*.msixbundle"
的包进行下载,即可获取最新的Beta版本的抓包