Skip to content

Instantly share code, notes, and snippets.

@iamurali
iamurali / statusline.sh
Last active May 3, 2026 10:08
Claude code status line with mode, context usage %age, shortened directory, branch
#!/bin/bash
# Read JSON input from stdin
input=$(cat)
echo "$input" > ~/.claude/debug_input.json
# Extract current directory and model name from JSON
cwd=$(echo "$input" | jq -r '.workspace.current_dir // .cwd')
model_name=$(echo "$input" | jq -r '.model.display_name')
# Start building output with model name in orange
conda info --envs
conda create --name rasa_chatboat python=3.6.5
conda activate rasa_chatboat
# ===> install rasa_nlu --> Download rasa_nlu and navigate to rasa_nlu-master folder
cd rasa_nlu-master
pip install -r requirements.txt
python3.6 -m pip install rasa_nlu==
python3.6 -m pip install rasa_nlu==0.12.3
@iamurali
iamurali / ddiff.sh
Last active January 25, 2019 15:23
Diff b/w dates shell script
echo "Enter date of backup date as YYYYMMDD"
read INPUT
GIVEN_DATE=$(date -j -f '%Y%m%d' "$INPUT" +%s)
CURRENT_DATE=$(date +%s)
NO_OF_DAYS=$(( (CURRENT_DATE - GIVEN_DATE) / 86400 ))
echo $NO_OF_DAYS
if [ $NO_OF_DAYS -gt 7 ]
then
#!/bin/bash
RESULT="Cache Name Status Type Config Value Run Value \n
------------------ -------- -------- -------------- ------------\n
default data cache Active Default 114867.00 Mb 114867.00 Mb\n
(1 row affected)\n
GATEWAY = ActiveMerchant::Billing::AuthorizeNetGateway.new(
login: ENV["AUTHORIZE_LOGIN"],
password: ENV["AUTHORIZE_PASSWORD"]
)
@iamurali
iamurali / comment.rb
Created December 2, 2017 20:00
User Gist
class Comment < ApplicationRecord
belongs_to :user
belongs_to :post
validates :user_id, :post_id, :content, presence: true
include CommonAttributes
def list_attributes
attribs = general_attribs
attribs[:user] = self.user.list_attributes
@iamurali
iamurali / homebrew_multiple_mysql_versions.md
Created June 27, 2016 18:19
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions with Homebrew

For homebrew version 0.9.5.

brew -v # => Homebrew 0.9.5

Install the current version of mysql.

# Install current mysql version

brew install mysql

NPM:::
npm install package-name -g
npm uninstall package-name
npm list --global
npm list
@iamurali
iamurali / gist:f40ddf190dcbfbc8836c
Last active September 23, 2015 08:06
git shortcuts
Put the following lines into your ~/.bash_aliases file,
then you can use the two or three character shortcuts to make your life a lot easier.
alias ga='git add'
alias gp='git push'
alias gl='git log'
alias gs='git status'
alias gd='git diff'
alias gm='git commit -m'
alias gma='git commit -am'
@iamurali
iamurali / gist:a4e3790f712e05162290
Last active August 29, 2015 14:20
Javascript Truthy and falsy

######The following values are always falsy:######

  • false
  • 0 (zero)
  • "" (empty string)
  • null
  • undefined
  • NaN (a special Number value meaning Not-a-Number!)

All other values are truthy, including "0" (zero in quotes), "false" (false in quotes), empty functions, empty arrays, and empty objects.