Skip to content

Instantly share code, notes, and snippets.

View mohitsehgal's full-sized avatar

Mohit Sehgal mohitsehgal

View GitHub Profile
@mohitsehgal
mohitsehgal / App.vue
Created August 25, 2020 17:11
Use MathliveInput to edit the mathematical equations in Vue App
<template>
<div id="app">
<h1>Hello Mathematical Equations</h1>
<p>I wrote $$e^{i\pi} + 1 = 0$$. Can you type it? </p>
<div style="width:50%;border:#aeaeae;background:#eeeeee">
<MathLiveInput :config="config" v-model="formula" v-on:input="input()">g(x)=</MathLiveInput>
</div>
<!-- <div id='output'>{{formula}}</div> -->
@mohitsehgal
mohitsehgal / MathLiveInput.vue
Created August 25, 2020 17:01
Vue component for Mathlive Wrapper to edit Mathematical Equations in your Vue App
<template>
<span class="mathfield" :id="id"><slot></slot></span>
</template>
<script>
/* eslint no-unused-vars: ["error", { "args": "none" }] */
import MathLive from "mathlive";
export default {
name: "MathLiveInput",
@mohitsehgal
mohitsehgal / .env
Created May 14, 2020 18:46
Basic Factor App .env file
FACTOR_ADMINS="mohit@appsyoda.dev"
DB_CONNECTION="mongodb://localhost/appsyodadev"
TOKEN_SECRET="This is my JWT secret"
@mohitsehgal
mohitsehgal / MainActivity.java
Last active May 13, 2020 15:22
SMS Reader Main Activity
package dev.appsyoda.sms_reader_broken_screen;
import android.app.Activity;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
public class MainActivity extends Activity {
@mohitsehgal
mohitsehgal / activity_main.xml
Created May 13, 2020 15:14
SMS Reader Activity XML Layout
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
@mohitsehgal
mohitsehgal / AndroidManifest.xml
Created May 13, 2020 15:08
Simple Android Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.appsyoda.myapplication">
<uses-permission android:name="android.permission.READ_SMS" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
@mohitsehgal
mohitsehgal / build.gradle
Last active May 13, 2020 15:08
build.gradle for logging SMS of old broken phone to Logcat.
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.1"
defaultConfig {
applicationId "dev.appsyoda.read_sms_broken"
minSdkVersion 8
targetSdkVersion 29
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="true">
<fragment
android:layout_height="match_parent"
@mohitsehgal
mohitsehgal / drawer_header
Last active August 29, 2015 14:23
Sample Header layout for Material Navigation Drawer in Android
<?xml version="1.0" encoding="utf-8"?>
<TextView
android:gravity="center"
android:textSize="22sp"
android:background="@color/primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:textColor="@android:color/white"
android:text="Mohit Sehgal"/>
@mohitsehgal
mohitsehgal / drawer_menu
Created June 18, 2015 11:24
Sample Menu Resource Layout for Material Design Navigation Drawer
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" >
<item android:id="@+id/menu_home"
app:showAsAction="withText"
android:icon="@mipmap/ic_home"
android:title="Home"/>
<item android:id="@+id/menu_event"
app:showAsAction="withText"
android:icon="@mipmap/ic_events"