Skip to content

Instantly share code, notes, and snippets.

@abhijeetchopra
abhijeetchopra / bash_strict_mode.md
Created February 9, 2022 17:27 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@abhijeetchopra
abhijeetchopra / curl.md
Created January 27, 2020 09:26 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@abhijeetchopra
abhijeetchopra / gist:a93d477fbd1f71a0b967fb262c66cf79
Created January 27, 2020 06:36 — forked from joemiller/gist:4048941
ssh-agent handler for bashrc/profile
# ~/.profile, ~/.bashrc, (or ~/.bash_profile in cygwin and others)
##########
## joe miller, ssh-agent handling stuff
##
SSH_ENV="$HOME/.ssh/environment"
SSH_KEY_PRIVATE="$HOME/.ssh/id_rsa"
SSH_KEY_PUB="$HOME/.ssh/id_rsa.pub"
function start-agent {
@abhijeetchopra
abhijeetchopra / script.R
Created May 1, 2017 01:39
K-means algorithm to find clusters
# Auth: Abhijeet Chopra
# CWID: 50180612
# Date: 30 Apr 2017
# Prog: K-means
# Desc: R Script to find cluster using k-means algorithm
# Meth: Classification Trees using C5.0
# -----------------------------------------
setwd("C:/Users/abhij/Desktop")
mydata <- read.csv("C:/Users/abhij/Desktop/mydata.csv", header = TRUE, stringsAsFactors=FALSE)
@abhijeetchopra
abhijeetchopra / RandomString.cpp
Created September 29, 2016 20:27
Randomly generate string with characters and numbers in C++
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
string randomString()
{
string str = "AAAAAA";
// string sequence
@abhijeetchopra
abhijeetchopra / RegularExpression.html
Last active July 31, 2016 06:12
RegularExpression
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>RegularExpression</title>
<script>
var str;
function buttonClick(){
@abhijeetchopra
abhijeetchopra / JS_table.html
Last active May 25, 2016 06:19
How to dynamically create HTML table with JavaScript and perform operations on events.
<html>
<head>
<title>My First HTML</title>
<script>
// This script is originally written for the Stackoverflow.com question: http://stackoverflow.com/q/37426390/4798534
function tableCreate() {
var body = document.getElementsByTagName('body')[0];
var tbl = document.createElement('table');
@abhijeetchopra
abhijeetchopra / 0-README.md
Last active April 24, 2024 20:40
Creating automatic scheduled backup copies of your Google Sheets using Google Apps Script

How to "Schedule Automatic Backups" of your Google Sheets

This tutorial demonstrates how to use Google Apps Script to:

  • Create copies of the Google Sheet in the desired destination folder automatically at set intervals.

  • Append the time stamp with each backup file's name.

  • Adjust time trigger for backing up every day/hour/minute.