Skip to content

Instantly share code, notes, and snippets.

Guljar Prasad guljarpd

  • Rivi
  • Bengaluru, India
Block or report user

Report or block guljarpd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@guljarpd
guljarpd / Commands.sh
Created May 2, 2018 — forked from nrollr/Commands.sh
Install PHP and NGINX on Amazon Linux AMI
View Commands.sh
## Install NGINX
$ sudo yum install nginx -y
## Install PHP and PHP-FPM
$ sudo yum install php -y
$ sudo yum install php-fpm -y
## Configure NGINX (see below)
$ sudo nano /etc/nginx/conf.d/default.conf
@guljarpd
guljarpd / mentions.js
Created Dec 1, 2018 — forked from nicubarbaros/mentions.js
Draft Js Mentions
View mentions.js
import { convertFromRaw, convertToRaw, ContentState } from 'draft-js';
const getIndicesOf = (searchStr, str, caseSensitive) => {
let tempStr = str;
let tempSearchStr = searchStr;
const searchStrLen = tempSearchStr.length;
if (searchStrLen === 0) {
return [];
}
let startIndex = 0;
@guljarpd
guljarpd / Guardian JWT.md
Created Jan 18, 2019 — forked from nikneroz/Guardian JWT.md
Elixir + Phoenix Framework + Guardian + JWT. This is tutorial and step by step installation guide.
View Guardian JWT.md

Elixir + Phoenix Framework + Guardian + JWT + Comeonin

Preparing environment

We need to generate secret key for development environment.

mix phoenix.gen.secret
# ednkXywWll1d2svDEpbA39R5kfkc9l96j0+u7A8MgKM+pbwbeDsuYB8MP2WUW1hf

Let's generate User model and controller.

@guljarpd
guljarpd / migrate-redis-db.sh
Created Aug 21, 2019
migrate redis db to another redis db.
View migrate-redis-db.sh
#!/bin/bash
#source DB (localhost or IP)
source_host=localhost
source_port=6379
source_db=0
#target DB (localhost or IP)
target_host=localhost2
target_port=6379
target_db=0
You can’t perform that action at this time.