Skip to content

Instantly share code, notes, and snippets.

View raxityo's full-sized avatar
👋

Raxit Majithiya raxityo

👋
View GitHub Profile
@raxityo
raxityo / Bing_Temper.js
Last active August 6, 2023 03:14
Tweaks on Bing Chat
// ==UserScript==
// @name Bing Tamper
// @namespace Violentmonkey Scripts
// @match https://www.bing.com/search
// @grant none
// @version 1.0
// @author -
// @description 3/17/2023, 11:59:35 AM
// ==/UserScript==
@raxityo
raxityo / generate_math_equations.js
Created July 5, 2023 18:57
A NodeJS script to generate math equations to submit evals for ChatGPT. Used by https://github.com/openai/evals/pull/1269.
const template = {
input: [
{
role: "system",
content:
"You are a skilled mathematician capable of solving math equations. Walk through the answer. Solve the equations with only the numerical answer rounded to 4 decimal places. Include the answer in square brackets []. Do not include comma in the answer."
},
{
role: "user",
content: "<TO_BE_FILLED>"
@raxityo
raxityo / DrawSparkline.js
Last active July 10, 2023 14:54
Draw Sparkline chart, converted by ChatGPT from https://alexplescan.com/posts/2023/07/08/easy-svg-sparklines/
// Define the default fill and stroke colors
const defaultFill = "#dcfce7";
const defaultStroke = "#bbf7d0";
// Define the stroke width
const strokeWidth = 4;
/**
* Draws a sparkline SVG based on the given width, height and points
* @param {number} width - The width of the SVG element
@raxityo
raxityo / mastodon_client.sh
Created February 21, 2024 15:17
Example implementation of a Mastodon API client
if [ -z $OAUTH_TOKEN ]
then
if [ -z $CLIENT_ID ]
then
APP_INFO=$(curl -s -X POST \
-F 'client_name=Example App' \
-F 'redirect_uris=urn:ietf:wg:oauth:2.0:oob' \
-F 'scopes=read' \
-F 'website=https://example.com' \
@raxityo
raxityo / adsense-calculator-data.json
Last active April 9, 2024 13:42
Raw data used by Google AdSense reveue calculator (don't trust the actual numbers, but you can use this as a reference)
[
{
"category": "News",
"multiplier": "0.97",
"region": "South America"
},
{
"category": "Sports",
"multiplier": "1.74",
"region": "South America"
# GitHub Action that will run prettier on the whole repo and commit the changes to the PR.
name: Prettier
on:
pull_request:
branches: [main]
jobs:
prettier:
runs-on: ubuntu-latest
@raxityo
raxityo / git_search.sh
Created January 6, 2025 18:01
git_search - Search for a term in git history and return related GitHub PRs or commit links
#!/bin/bash
# Search for a term in git history and return related GitHub PRs or commit links
# Usage: git_search [-r] <search_string>
# -r: use regex pattern matching instead of exact string matching
#
# Examples:
# git_search "someFunction"
# git_search -r ".*Pattern.*"
function git_search() {
@raxityo
raxityo / created_at_trigger.md
Created February 1, 2025 01:30
PostgreSQL Auto-Update `created_at` Trigger

PostgreSQL Auto-Update created_at Trigger

This guide explains how to automatically add a trigger to update the created_at column in PostgreSQL whenever a table is created or modified to include that column.

Overview

  • When a table is created or altered to include a created_at column, a trigger is automatically added.
  • The trigger ensures that created_at is set to NOW() on INSERT.
  • An event trigger listens for CREATE TABLE and ALTER TABLE commands and applies the logic.
import Charts
import SwiftUI
// Models
struct Expense: Identifiable, Hashable, Codable {
var id = UUID()
var title: String
var amount: Double
var date: Date
var category: Category
@raxityo
raxityo / agent loop
Created March 10, 2025 12:30 — forked from jlia0/agent loop
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet