Skip to content

Instantly share code, notes, and snippets.

View RohanBhanderi's full-sized avatar
🎯
Focusing

Rohan Bhanderi RohanBhanderi

🎯
Focusing
View GitHub Profile
@RohanBhanderi
RohanBhanderi / dates.sql
Created December 14, 2020 02:31
Postgrsql dates days
WITH compr_as AS (
SELECT s as created
FROM generate_series( -- this would produce timestamps with 20 minutes step
(now() - '20 days'::interval)::date,
(now() + '20 days'::interval)::date,
'20 minutes'::interval) AS s
)
SELECT to_char( created, 'DY'::TEXT), created,
date_trunc('week', CURRENT_DATE - interval '1 week') as start_dt,
date_trunc('week', CURRENT_DATE) as end_dt
@RohanBhanderi
RohanBhanderi / mac-os-setup.sh
Last active December 13, 2020 23:37
Mac OS Setup
# install xcode tools
xcode-select --install
# install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew update
# update iterm2 settings, ohmyzsh
brew install --cask iterm2
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@RohanBhanderi
RohanBhanderi / cloudSettings
Last active December 14, 2020 00:37
vscode-settings
{"lastUpload":"2020-12-14T00:37:16.231Z","extensionVersion":"v3.4.3"}
const DEFAULT_PROCESS_ASYNC = true;
// config.processAsync may be undefined but never null
const config = {
processAsync: undefined,
};
// default value assignment
const {
processAsync = DEFAULT_PROCESS_ASYNC,
@RohanBhanderi
RohanBhanderi / adobe_stock_plugin.py
Created June 23, 2017 00:07
Blender Plugin for Adobe Stock
import bpy
import requests
import json
class GetOperator(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.get_operator"
bl_label = "Search"
@RohanBhanderi
RohanBhanderi / vi_commands
Created September 14, 2015 18:23
vi commands
Commands
-------------------------------
:q exit if there are no changes
:q! exit without save
:wq,:x save and exit
:w save
u Undo last change
U undo all changes to the line
@RohanBhanderi
RohanBhanderi / Kill process running on a port
Created May 5, 2015 20:46
Kill process running on a port
netstat -a -n -o | findstr :3000
TaskKill /PID <processID> /T /F
@RohanBhanderi
RohanBhanderi / MomentJS Date to String
Last active August 29, 2015 14:20
MomentJS date to string conversions
// For converting javascript dates to string
ar formatedDateString = moment(date).format('YYYY-MM-DD');
@RohanBhanderi
RohanBhanderi / Git_mergetool_commands
Last active March 13, 2024 12:16
Git Mergetool and difftool with Beyond Compare 4
//Git Mergetool and difftool with Beyond Compare 4
//For Windows
//IF running this command in git bash then escape $ with \
git config --global diff.tool bc4
git config --global difftool.bc4.cmd "\"C:/Program Files (x86)/Beyond Compare 4/BCompare.exe\" \"\$LOCAL\" \"\$REMOTE\""
git config --global difftool.prompt false
git config --global merge.tool bc4
git config --global mergetool.bc4.cmd "\"C:/Program Files (x86)/Beyond Compare 4/BCompare.exe\" \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\""
git config --global mergetool.bc4.trustExitCode true
@RohanBhanderi
RohanBhanderi / SSL_Cert_Request
Created April 2, 2015 08:22
SSL Cerificate Signing Request Steps
# For configuring OpenSSL
#1
set OpenSSL_HOME=C:\OpenSSL
#2
set OpenSSL_CONF=path-to-your-OpenSSL-installation\bin\openssl.cfg
#3
set Path=%Path%;%OpenSSL_HOME%\bin
#For generating CSR
#1 Create a Private Key