Skip to content

Instantly share code, notes, and snippets.

View 211211's full-sized avatar

Quan Nguyen 211211

View GitHub Profile
@211211
211211 / elasticsearch-scroll.js
Created February 22, 2022 18:12 — forked from johnnybui/elasticsearch-scroll.js
Get all documents from Elasticsearch index by scroll method
const elasticsearch = require('elasticsearch');
const esClient = new elasticsearch.Client({
host: 'YOUR ELASTICSEARCH SERVER'
});
/**
* Get all documents of an Elasticsearch index by scroll method
* @param {string} index Index to get documents
* @param {Object} query Querying object
@phortuin
phortuin / postgres.md
Last active August 18, 2025 04:04
Set up postgres + database on MacOS (M1)

Based on this blogpost.

Install with Homebrew:

$ brew install postgresql@14

(The version number 14 needs to be explicitly stated. The @ mark designates a version number is specified. If you need an older version of postgres, use postgresql@13, for example.)

@jjcodes78
jjcodes78 / nextjs-deploy.md
Last active October 4, 2025 17:38
Deploying NEXTJS site with nginx + pm2

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@marudhupandiyang
marudhupandiyang / wrappedBlurView.jsx
Last active December 10, 2019 19:58
Wrapper over blur view to make the implementation consistent in both android and ios. https://medium.com/@marudhupandiyang/blurring-views-inreact-native-7d20144c8d7c
import React, { Component } from 'react';
import { findNodeHandle, Platform, Dimensions } from 'react-native';
import { BlurView } from 'react-native-blur';
const { width: viewportWidth, height: viewportHeight } = Dimensions.get('window');
const isAndroid = Platform.OS === 'android';
class WrappedBlurView extends Component {
constructor(props) {
super(props);
@andrhamm
andrhamm / callbacks.js
Last active April 27, 2022 17:01
Paginating Scans & Queries in DynamoDB with Node.js using Callbacks OR Promises
const AWS = require('aws-sdk');
AWS.config.logger = console;
const dynamodb = new AWS.DynamoDB({ apiVersion: '2012-08-10' });
let val = 'some value';
let params = {
TableName: "MyTable",
ExpressionAttributeValues: {
@cazala
cazala / guide.md
Created January 2, 2018 16:19 — forked from menduz/guide.md
Frontend React + TypeScript guidelines

Directory Structure

The sources of the project follows this structure:

/src
  /app
    /{domain}
      /actions.ts
 /actions.spec.ts
@wojteklu
wojteklu / clean_code.md
Last active December 12, 2025 01:36
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules