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 / inlinestyles
Created December 13, 2018 05:29
Inline Styles
render() {
onSubmit=()=>{}
return (
<View style={{flex:1, flexDirection:'row', backgroundColor:'black'}}>
<Button
title={"Submit"}
onPress={this.onSubmit}/>
</View>
);
export default class example extends React.Component {
state = {
name : ''
}
setName=(name)=>{
this.setState({ name })
}
@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) => {
@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 / 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;
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]),
recordiOSSimulator() {
echo -n "Started iOS simulator recording";
echo -n "Use CTRL+C to stop recording";
xcrun simctl io booted recordVideo "$1";
}
if [ -f ~/.bash_profile ]
then
echo bash profile exists
else
echo bash profile does not exists
fi
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 = [];
@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: ""},