Skip to content

Instantly share code, notes, and snippets.

View nsdevaraj's full-sized avatar
🎯
Focusing

N.S.Devaraj nsdevaraj

🎯
Focusing
View GitHub Profile
cut -f 3,4,5,6,7,8 -d, ~/Downloads/debugs.csv > ~/Downloads/new.csv
sed 's/.\(.*\)/\"https\:\/\/dev\.azure\.com\/lumel\/Inforiver\/_queries\/edit\/\1/' ~/Downloads/new.csv > ~/Downloads/data.csv
sed '1d' ~/Downloads/data.csv > ~/Downloads/analytics.csv
cut -f 3,4,5,6,7,8 -d, ~/Downloads/Blockers.csv > ~/Downloads/new.csv
sed 's/.\(.*\)/\"https\:\/\/dev\.azure\.com\/lumel\/Inforiver\/_queries\/edit\/\1/' ~/Downloads/new.csv > ~/Downloads/data.csv
sed '1d' ~/Downloads/data.csv > ~/Downloads/matrix.csv
cd ~/repo/ibcslibrary
gh pr list --json title,url,author,reviewRequests,createdAt > ~/Downloads/data.json
~/Documents/jq 'foreach .[] as $item (0; . + 1; {author: $item.author.name, createdAt: $item.createdAt, title: $item.title, url: $item.url, reviews: $item.reviewRequests[0].login, reviews2: $item.reviewRequests[1].login })' ~/Downloads/data.json > ~/Downloads/data2.json
sed -e 's/}/},/' ~/Downloads/data2.json > ~/Downloads/data.json
{ echo '[ '; cat ~/Downloads/data.json; } > ~/Downloads/data2.json
sed '$ s/.$//' ~/Downloads/data2.json > ~/Downloads/data.json
{ cat ~/Downloads/data.json; echo '] ';} > ~/Downloads/data2.json
in2csv ~/Downloads/data2.json > ~/Downloads/data.csv
sed -e 's/T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\+[0-9][0-9]:[0-9][0-9]/ /g' ~/Downloads/data.csv > ~/Downloads/new.csv
csvsort -c 1 ~/Downloads/new.csv > ~/Downloads/data.csv
@nsdevaraj
nsdevaraj / counter.sh
Last active March 6, 2024 14:57
get console log to file
count=840
declare -i count
echo "Prepare to launch"
while [[ $count -gt 99 ]]; do
sleep 1
echo "$count"
node tra.js "0"$count
count=$count-1
done
sleep 1
@nsdevaraj
nsdevaraj / repeat text
Created March 5, 2024 02:17
excel repeat text
=TOCOL(TEXTSPLIT(TEXTJOIN("",TRUE,REPT(ROW(C1:C133)&",",C1:C133)),",",,TRUE)*1,3)
=DROP(REDUCE("",E1:E1330,LAMBDA(a,v,VSTACK(a,IFNA(VLOOKUP(v,HSTACK(ROW(A1:A133),A1:B133),{2,3},FALSE),{"",""})))),1)
@nsdevaraj
nsdevaraj / scrap.py
Created March 3, 2024 12:06
blogspot scrapper
"""
This script scrapes a Blogspot blog by iterating back in its history.
Usage:
1. Provide blogspot links
2. Press CTRL-C when you want to stop it.
Note: Your IP-number may be temporarily banned from the Blogger service if over-used.
Use on your own risk.
"""
@nsdevaraj
nsdevaraj / viewController.swift
Created February 8, 2024 13:44
Load any webpage
//
// ViewController.swift
// WebEmbed
//
// Created by Devaraj NS on 08/02/24.
//
import Cocoa
import WebKit
@nsdevaraj
nsdevaraj / multiplycsv.py
Last active February 4, 2024 09:42
raw data css
import pandas as pd
import numpy as np
from datetime import datetime, timedelta
# Read the CSV file
df = pd.read_csv('Rawdata.csv')
# Define the start and end dates
start_date = datetime(2020, 1, 1)
end_date = datetime(2024, 12, 31)
# Generate a list of dates within the specified range
@nsdevaraj
nsdevaraj / macro
Created November 13, 2023 06:08
ppt macro
' Create a new presentation
Set ppt = Presentations.Add
' Add title slide
Set sld = ppt.Slides.Add(1, ppLayoutTitle)
Set shp = sld.Shapes.Title
Set txt = shp.TextFrame.TextRange
txt.Text = "Business Intelligence (BI)"
txt.Font.Size = 44
txt.Font.Bold = True
// Import the d3 library
var d3 = require("d3");
// Define the circle and proportions
var center = {x: 0, y: 0};
var radius = 1;
var proportions = [0.2, 0.3, 0.5];
// Create the Voronoi diagram
var voronoi = d3.voronoi()
import csv
# Open a CSV file for writing
with open('years_and_months.csv', 'w', newline='') as csvfile:
# Create a CSV writer
csvwriter = csv.writer(csvfile)
# Write the header
csvwriter.writerow(['Year', 'Month'])