Skip to content

Instantly share code, notes, and snippets.

View iSanjayAchar's full-sized avatar

Sanjay Achar iSanjayAchar

  • Senior Software Engineer
  • Bengaluru
View GitHub Profile
@iSanjayAchar
iSanjayAchar / script.sh
Last active November 26, 2021 07:07
Script
history
echo "I'm inside"
echo "Creating a dummy file"
touch dummy-file
echo "Adding to git"
git add .
git commit -m 'This is a test'
@iSanjayAchar
iSanjayAchar / order.json
Last active May 18, 2019 10:23
MongoDB Classes
{
"timestamp": "2019-05-18T10:20:54+0000",
"user_id": ObjectId("5cdfce277b0c5ee88b24069c"),
"orders": [ObjectId("5cdfd3887b0c5ee88b2406a0"), ObjectId("5cdfd46c7b0c5ee88b2406a2")],
"price": {
"delivery_charges": 30,
"taxes": 10,
"total": 110
}
}
@iSanjayAchar
iSanjayAchar / recorder.js
Created October 23, 2018 06:21
Record Audio using JavaScript and Output in Base64
let recorder = null;
const onsuccess = (stream) => {
recorder = new MediaRecorder(stream, {
type: 'audio/ogg; codecs=opus'
});
recorder.start(); // Starting the record
recorder.ondataavailable = (e) => {
@iSanjayAchar
iSanjayAchar / app.module.ts
Created September 8, 2018 11:40
Ionic 2+ | Angular 2+ | @angular/http module | HTTP Interceptor
import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicErrorHandler, IonicModule, AlertController, LoadingController } from 'ionic-angular';
import { MyApp } from './app.component';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { HttpModule, RequestOptions, XHRBackend } from '@angular/http';
import { LocalStorageProvider } from '../providers/local-storage/local-storage';
import { httpService } from '../providers/http/http';
@iSanjayAchar
iSanjayAchar / disable-clipboard.component.html
Last active July 28, 2018 18:56
Disabled Clipboard Actions: Angular 2+
<div appDisableClipboard>
<!--
Your HTML Content here
-->
</div>
@iSanjayAchar
iSanjayAchar / gist:3f25bc946e0f7f5c4c3895706fa6336b
Created May 26, 2016 08:36
Google App Script to Log Time And Date onEdit
function onEdit(e) {
var sheet = e.source.getActiveSheet();
var activeCell = sheet.getActiveCell();
var col = activeCell.getColumn();
var row = activeCell.getRow();
if (col == 2 ) { // assuming status is in column 2, adapt if needed
sheet.getRange(row, col+1).setValue(new Date()).setNumberFormat('MMM dd yyyy - HH:mm');// change the display format to your preference here
}
}