Skip to content

Instantly share code, notes, and snippets.

@0xdevalias
0xdevalias / reverse-engineering-webpack-apps.md
Last active March 7, 2026 02:53
Some notes and techniques for reverse engineering Webpack (and a little bit about React/Vue/Angular) apps
@darwinsubramaniam
darwinsubramaniam / forRootAndForFeature.md
Last active January 31, 2024 08:37
The Explaination of forRoot and ForFeature

ForRoot

This is useful when the registerAs is required across, so it is best to use it in the AppModule

import databaseConfig from './config/database.config';
@Module({
  imports: [
    ConfigModule.forRoot({
      load: [databaseConfig],
 }),
@slikts
slikts / react-memo-children.md
Last active October 19, 2025 02:45
Why using the `children` prop makes `React.memo()` not work

nelabs.dev

Why using the children prop makes React.memo() not work

I've recently ran into a pitfall of [React.memo()][memo] that seems generally overlooked; skimming over the top results in Google just finds it mentioned in passing in a [React issue][regit], but not in the [FAQ] or API [overview][react-api], and not in the articles that set out to explain React.memo() (at least the ones I looked at). The issue is specifically that nesting children defeats memoization, unless the children are just plain text. To give a simplified code example:

const Memoized = React.memo(({ children }) => (<div>{children}</div>));
// Won't ever re-render
<Memoized>bar</Memoized>
// Will re-render every time; the memoization does nothing
@fworks
fworks / install-zsh-windows-git-bash.md
Last active January 21, 2026 17:51
Zsh / Oh-my-zsh on Windows Git Bash
@AkatQuas
AkatQuas / event-loop.md
Last active June 28, 2022 13:32
Depth in Event Loop, both browser and Node.js.

Depth in Event Loop

For those JavaScript programmers, event loop is an important concept, inevitably.

Literally, event loop is what JavaScritp uses to implement non-blocking execution. Understanding how the event loops works internally would benefit you a lot when programming in JavaScript.

There are two major environments JavaScript runs in: browser and Node.js.

Browser

@marcj
marcj / docker-run.ts
Last active December 5, 2021 15:18
Dockerode Docker run with STDIN in Node.Js
import * as Dockerode from "dockerode";
import * as stream from "stream";
import {ContainerCreateOptions, HostConfig} from "dockerode";
export async function dockerRunWithStdIn(
docker: Dockerode,
stdin: NodeJS.ReadableStream | Buffer,
options: {name: string} & ContainerCreateOptions
): Promise<Buffer> {
return await new Promise<Buffer>(async (resolve, reject) => {
@pavankjadda
pavankjadda / How to fix gitignore not working issue.md
Last active December 17, 2025 04:20
How to fix "gitignore not working" issue

FYI: Created blog post with more details

How to fix ".gitignore not working" issue?

Sometimes git does not exclude files/folders added .gitignore especially if you had commited them before. Here is how to fix it. I am ignoring node_modules from Angular project as an example

  1. Update .gitignore with the folder/file name you want to ignore. You can use anyone of the formats mentioned below (prefer format1)
### Format1  ###
node_modules/
@soulmachine
soulmachine / jwt-expiration.md
Last active June 19, 2025 15:38
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@Lcjc
Lcjc / quickSort.java
Last active December 29, 2020 04:27
Quick Sort (last element as pivot)
public class Solution {
public int[] quickSort(int[] array) {
//corner cases
if(array == null) return array;
quickSort2(array, 0, array.length-1);
return array;
}
//quicksort recursive method
@roommen
roommen / Hybrid (Windows+Linux) Docker Swarm
Last active February 17, 2025 14:46
Hybrid (Windows+Linux) Docker Swarm
**********************
*** Pre-requisites ***
**********************
1. Set up Windows 2016 password:
gcloud beta compute --project <project_id> reset-windows-password <instance_name> --zone <zone_name>
ip_address: <ip_address>
password: <defult_password_generated>
username: <username>
3. Installing Docker: