Skip to content

Instantly share code, notes, and snippets.

View imbudhiraja's full-sized avatar
🤟
A Creative, Adventures and Curious Full Stack Developer.

Manish Budhiraja imbudhiraja

🤟
A Creative, Adventures and Curious Full Stack Developer.
View GitHub Profile
@imbudhiraja
imbudhiraja / file-downloader-action-types.js
Created May 6, 2021 11:45
File downloader with redux-saga and ReactJS
import { createAction } from 'redux-actions';
export const DOWNLOAD_FILE = 'DOWNLOAD_FILE';
export const downloadFile = createAction(DOWNLOAD_FILE);
export const DOWNLOAD_FILE_FAILURE = 'DOWNLOAD_FILE_FAILURE';
export const downloadFileFailure = createAction(DOWNLOAD_FILE_FAILURE);
export const DOWNLOAD_FILE_REQUESTED = 'DOWNLOAD_FILE_REQUESTED';
export const downloadFileRequested = createAction(DOWNLOAD_FILE_REQUESTED);
-------------------------------------- SERVER SETUP STEPS -------------------------------------------------------
******************************* DEPENDENCIES INSTALLATION *******************************
1. Check ubuntu version using command, lsb_release -a
2. Install apache according to ubuntu version
3. apt-get update
4. apt-get install apache2
5. INSTALL NVM FROM HERE---------------- https://gist.github.com/d2s/372b5943bce17b964a79
6. Install Node - nvm install v8.9.0 or higher
7. Install MongoDB - https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
@imbudhiraja
imbudhiraja / url-schemes or package names
Created July 25, 2019 10:55
List of url-schemes and packages of popular iOS and android Applications
export const apps = {
"whatsapp": {pkgName: "com.whatsapp", urlScheme: "whatsapp", urlParams: "app"}, // fa
"facebook": {pkgName: "com.facebook.katana", urlScheme: "fb", urlParams: "requests"}, // fa: facebook-official
"facebook messenger": {pkgName: "com.facebook.orca", urlScheme: "fb-messenger", urlParams: "user-thread/{user-id}"}, // fa: facebook
"skype": {pkgName: "com.skype.raider", urlScheme: "skype", urlParams: "echo123?call"}, // fa
"wechat": {pkgName: "com.tencent.mm", urlScheme: "weixin", urlParams: "dl/chat"}, // fa
"snapchat": {pkgName: "com.snapchat.android", urlScheme: "snapchat", urlParams: "?u=foo"}, // fa
"twitter": {pkgName: "com.twitter.android", urlScheme: "twitter", urlParams: "messages"}, // fa
"youtube": {pkgName: "com.google.android.youtube", urlScheme: "youtube", urlParams: "watch?v=dQw4w9WgXcQ"}, // fa
"netflix": {pkgName: "com.netflix.mediaclient", urlScheme: "nflx", urlParams: ""},
import moment from 'moment';
import cloneDeep from 'lodash/cloneDeep';
import querystring from 'querystring';
const calendarDateFormat = 'YYYY-MM-DD HH:mm:ss';
const displayDateFormat = 'DD-MM-YYYY hh:mm A';
const createEvents = (event, query) => {
let events = [];
if [ -f ~/.bash_profile ]
then
echo bash profile exists
else
echo bash profile does not exists
fi
recordiOSSimulator() {
echo -n "Started iOS simulator recording";
echo -n "Use CTRL+C to stop recording";
xcrun simctl io booted recordVideo "$1";
}
import _ from 'lodash';
const keysTo = (keys) => {
if (Array.isArray(keys)) {
return keys.map((key) => snakeCaseCreator(key));
} if (_.isPlainObject(keys)) {
return Object.keys(keys).reduce(
(result, key) => ({
...result,
[_.snakeCase(key)]: snakeCaseCreator(obj[key]),
@imbudhiraja
imbudhiraja / email-template.html
Last active April 4, 2019 12:43
Email Template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Mail</title>
<style type="text/css">
#outlook a {
padding: 0;
@imbudhiraja
imbudhiraja / reset-password.html
Last active April 4, 2019 12:44
Reset Password
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Mail</title>
<style type="text/css">
#outlook a {
padding: 0;
@imbudhiraja
imbudhiraja / convert-keys-to-camel-case
Last active February 24, 2023 14:38
Converting Object Keys from Snake Case, Kebab Case to Camel Case with JavaScript
const mongoose = require('mongoose');
const toCamel = (string) => string.replace(/([-_][a-z])/gi, ($1) => $1
.toUpperCase()
.replace('-', '')
.replace('_', ''));
const isObject = (args) => args === Object(args) && !Array.isArray(args) && typeof args !== 'function';
const keysToCamel = (args) => {