Skip to content

Instantly share code, notes, and snippets.

View princetechs's full-sized avatar

sandip parida princetechs

View GitHub Profile
@princetechs
princetechs / setup-claude-telemetry.sh
Last active April 20, 2026 11:45
setup-claude-telemetry.sh
cat > setup-claude-telemetry.sh << 'ENDSCRIPT'
#!/usr/bin/env bash
#
# Claude Code Telemetry → Grafana Cloud Setup
# Fixed version - no variable scoping issues
set -euo pipefail
if [ -t 1 ]; then
R=$'\033[0;31m'; G=$'\033[0;32m'; Y=$'\033[1;33m'; B=$'\033[0;34m'; N=$'\033[0m'
@princetechs
princetechs / rails_admin importmap issue with cant find path
Created May 30, 2024 12:38
rails_admin importmap issue with cant find path
### Proposed Solution
### **Problem** :- _cant find the path **@import "rails_admin/src/rails_admin/styles/base";
- because import work with js you have to install the npm pakage of rails_admin ,
- **For pro quick solve** :-
> look for my gem url and package.json
1. **Ensure Proper Gem Installation**:
- Add the Rails Admin gem to your Gemfile:
@princetechs
princetechs / make a wrapper of api with method_missing and respond
Created November 25, 2023 11:27
make a wrapper of api with method_missing and respond
class Book
DEV_CALL=["first","last","second"]
require 'net/http'
include ActiveModel::Model
attr_accessor :user_token, :books
BASE_URL = "http://127.0.0.1:3000/api/books/".freeze
def self.user(auth_token)
body {
background: #f6f5f7;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
font-family: 'Montserrat', sans-serif;
height: 100vh;
@princetechs
princetechs / html erb file :- rails hot wire code for sign up and sign in slider
Created November 23, 2023 14:25
html erb file :- rails hot wire code for sign up and sign in slider
<div class="container" id="container" data-controller="auth-form">
<div class="form-container sign-up-container">
<form action="#" name="register">
<h1>Create Account</h1>
<div class="social-container hidden">
<a href="#" class="social"><i class="fab fa-facebook-f"></i></a>
<a href="#" class="social"><i class="fab fa-google-plus-g"></i></a>
<a href="#" class="social"><i class="fab fa-linkedin-in"></i></a>
</div>
<span>or use your email for registration</span>
@princetechs
princetechs / rails hot wire code for sign up and sign in slider
Created November 23, 2023 14:25
rails hot wire code for sign up and sign in slider
import { Controller } from '@hotwired/stimulus';
export default class extends Controller {
static targets = ["name", "email", "password"];
connect() {
const signUpButton = this.element.querySelector('#signUp');
const signInButton = this.element.querySelector('#signIn');
signUpButton.addEventListener('click', () => {
@princetechs
princetechs / tailwind for protofolio
Created September 27, 2023 07:36
chat ui using tailwind
import React from 'react';
const Chatbox = () => {
return (
<div className="flex flex-col h-screen">
<div className="flex items-center justify-between bg-purple-500 px-4 py-2">
<h1 className="text-white font-bold text-lg">Chatbox</h1>
<button className="text-white">
<i className="fas fa-times"></i>
</button>
@princetechs
princetechs / gist:b4332c9505bef05e9de69d7809a80d66
Created September 26, 2023 19:56
a tkintre todo app using code interpreter
import tkinter as tk
window = tk.Tk()
window.title('Todo App')
# Create a text entry widget
entry = tk.Entry(window)
entry.pack()
# Create a button to add tasks