Skip to content

Instantly share code, notes, and snippets.

View jaamaalxyz's full-sized avatar
🎯
Focusing

Md. Jamal Uddin jaamaalxyz

🎯
Focusing
View GitHub Profile
@imasif
imasif / exportDB.sh
Last active June 22, 2020 13:57
Export mongodb database into JSON files, and import the JSON again.
#!/bin/bash
if [ ! $1 ]; then
echo " Example of use: $0 database_name dir_to_store"
exit 1
fi
db=$1
out_dir=$2
if [ ! $out_dir ]; then
out_dir="./"
@sjsakib
sjsakib / README.md
Last active February 6, 2020 21:59
This script gets a random featured image from unsplash.com and sets it as your desktop background. Works on `gsettings` supported linux distros. Tested on Ubuntu 19.10 (Gnome). Requires the `requests` module to be installed. It takes some time to download the photo. So, wait patiently after executing the script. You can use `anacrontab` to run i…

This script gets a random featured image from unsplash.com and sets it as your desktop background. Works on gsettings supported linux distros. Tested on Ubuntu 19.10 (Gnome). Requires the requests module to be installed.

It takes some time to download the photo. So, wait patiently after executing the script.

You can use anacrontab to run it daily or weekly. See http://bit.ly/371ybhq

@stettix
stettix / things-i-believe.md
Last active March 20, 2024 17:45
Things I believe

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette. See also my blog at www.janvsmachine.net.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

@silver-xu
silver-xu / ts-boilerplate.md
Last active June 19, 2024 15:10
Setup a Node.js project with Typescript, ESLint, Prettier, Husky

Setup a Node.js project with Typescript, ESLint, Prettier, Husky

1_D8Wwwce8wS3auLAiM3BQKA

Starting a personal node project could be easy; starting a team node project could be challenging.

I am a developer currently working in SEEK Australia.

In my experience, common mistakes developer make when starting a projects are:

  • No Linting
@theanam
theanam / otpverify.js
Last active June 14, 2024 15:01
OTP verification without database, full sample source code
const otpGenerator = require("otp-generator");
const crypto = require("crypto");
const key = "verysecretkey"; // Key for cryptograpy. Keep it secret
function createNewOTP(phone){
// Generate a 6 digit numeric OTP
const otp = otpGenerator.generate(6, {alphabets: false, upperCase: false, specialChars: false});
const ttl = 5 * 60 * 1000; //5 Minutes in miliseconds
const expires = Date.now() + ttl; //timestamp to 5 minutes in the future
const data = `${phone}.${otp}.${expires}`; // phone.otp.expiry_timestamp
@MunifTanjim
MunifTanjim / RoutineTermSectionEdit.js
Created April 28, 2019 20:47
React Hooks Component Example
import Form from 'components/Form/Form'
import HeaderGrid from 'components/HeaderGrid'
import { connect as connectFormik, Formik } from 'formik'
import { defaultsDeep, get, groupBy, map, zipObject } from 'lodash-es'
import React, { useCallback, useEffect, useMemo, useReducer } from 'react'
import { connect } from 'react-redux'
import {
Button,
Dropdown,
FormField,
@bradtraversy
bradtraversy / docker_wordpress.md
Last active June 19, 2024 17:24
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
version: '3.2'
services:
db:
# Specify the version of DB you want to run
image: mysql:5.7
volumes:
# TODO: create a directory "db_data" in the root folder of your installation
- db_data:/var/lib/mysql
restart: always
environment:
@bvaughn
bvaughn / index.md
Last active April 3, 2024 07:41
Interaction tracing with React

This API was removed in React 17


Interaction tracing with React

React recently introduced an experimental profiler API. After discussing this API with several teams at Facebook, one common piece of feedback was that the performance information would be more useful if it could be associated with the events that caused the application to render (e.g. button click, XHR response). Tracing these events (or "interactions") would enable more powerful tooling to be built around the timing information, capable of answering questions like "What caused this really slow commit?" or "How long does it typically take for this interaction to update the DOM?".

With version 16.4.3, React added experimental support for this tracing by way of a new NPM package, scheduler. However the public API for this package is not yet finalized and will likely change with upcoming minor releases, so it should be used with caution.