Skip to content

Instantly share code, notes, and snippets.

View malhotrachetan's full-sized avatar
💭
💻

Chetan Malhotra malhotrachetan

💭
💻
View GitHub Profile
@malhotrachetan
malhotrachetan / clean-git-commit-history.sh
Created July 8, 2019 10:45
Script to clean your commit history from git
git pull
git checkout --orphan temp_branch
git add -A
git commit -am "commit"
git branch -D master
git branch -m master
git push -f origin master
@malhotrachetan
malhotrachetan / install_talib.sh
Last active June 1, 2019 08:39
Install talib
apt-get install -y wget gcc build-essential python3-dev python3-setuptools
export PATH=/usr/local/bin:$PATH
git clone https://github.com/debuggermalhotra/install_libkloudtrader.git
cd install_libkloudtrader
./configure --prefix=/usr
make
make install
@malhotrachetan
malhotrachetan / cell1
Created June 1, 2019 08:34
Plotly on google colab/kaggle
def configure_plotly_browser_state():
import IPython
display(IPython.core.display.HTML('''
<script src="/static/components/requirejs/require.js"></script>
<script>
requirejs.config({
paths: {
base: '/static/base',
plotly: 'https://cdn.plot.ly/plotly-1.5.1.min.js?noext',
},
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include<stdio.h>
#include <math.h>
#include<conio.h>
#define ESP 0.001
#define F(x) (x)*(x)*(x) + (x)*(x) + (x) + 7
void main()
{
int i = 1;
float x0,x1,x2;
double f1,f2,f0,t;
P40AUTO TC MAKECADR # HELLO THERE.
TS TEMPR60 # FOR GENERALIZED RETURN TO OTHER BANKS.
P40A/P TC BANKCALL # SUBROUTINE TO CHECK PGNCS CONTROL
CADR G+N,AUTO # AND AUTO STABILIZATION MODES
CCS A # +0 INDICATES IN PGNCS, IN AUTO
TCF TURNITON # + INDICATES NOT IN PGNCS AND/OR AUTO
CAF APSFLBIT # ARE WE ON THE DESCENT STAGE?
MASK FLGWRD10
CCS A
TCF GOBACK # RETURN
import speech_recognition
import pyttsx
speech_engine = pyttsx.init('sapi5') # see http://pyttsx.readthedocs.org/en/latest/engine.html#pyttsx.init
speech_engine.setProperty('rate', 150)
def speak(text):
speech_engine.say(text)
speech_engine.runAndWait()
import java.util.Scanner;
public class calculator {
public static void main(String[] args) {
System.out.println("\t\t\t\tCALCULATOR\t\t\t\t");
System.out.println("write add for addition");
System.out.println("write sub for subtraction");
System.out.println("write prod for multiplication");
System.out.println("write div for division");