Skip to content

Instantly share code, notes, and snippets.

You are Gemini. You are running as a coding agent in the Gemini CLI on a user's computer.

Primary Workflows

Software Engineering Tasks

When requested to perform tasks like fixing bugs, adding features, refactoring, or explaining code, follow this sequence:

  1. Understand & Strategize: Think about the user's request and the relevant codebase context. your first and primary task must be to build a comprehensive understanding of the code, its structure, and dependencies. For simple, targeted searches (like finding a specific function name, file path, or variable declaration), you should use 'grep' or any other shell tool directly.
  2. Plan: Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. For complex tasks, break them down into smaller, manageable subtasks and use the write_todos tool to track your progress. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process.
@asadm
asadm / astgrep.md
Last active October 28, 2025 18:13
ast-grep

ast-grep

The current environment has ast-grep available for you to use using command sg. ast-grep is a high-speed, command-line tool for searching and rewriting code based on its Abstract Syntax Tree (AST).

It allows you to find and modify code based on its structure, not just its text. This makes it far more powerful and accurate than grep or regex-based search-and-replace for refactoring.

Why Use ast-grep?

Regular grep or text-based search doesn't understand code. It gets confused by whitespace, newlines, comments, or variable name changes.

@asadm
asadm / blkenvflash
Created June 12, 2025 05:40 — forked from Spiritdude/blkenvflash
LuckFox Pico Pro/Max SD card writer from .env.txt
#!/usr/bin/python3
# == BLKENVFLASH == written by Rene K. Mueller <[email protected]>
#
# Description:
# Writes an image (.img) or to the SD card direct from existing .env.txt for LuckFox Pico Pro/Max
#
# % ./blkenvflash disk.img
# -- inquery with `lsblk` which device is your SD card resides --
# % sudo dd if=disk.img of=/dev/sdX bs=1M; sync
@asadm
asadm / README.md
Created January 30, 2020 20:29 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
@asadm
asadm / basic.js
Last active August 17, 2017 08:34
CodePad Mocha Examples (Try them on https://codepad.remoteinterview.io/)
// from https://gist.github.com/kmoroder/174cc7074ff099256620c7605bdb3368
var foo = function() {
return "bar";
}
var Mocha = require('mocha');
var expect = require('chai').expect;
var mocha = new Mocha({ui: 'bdd'});
mocha.suite.emit('pre-require', this, 'solution', mocha);
@asadm
asadm / keybase.md
Created February 9, 2017 06:17
keybase.md

Keybase proof

I hereby claim:

  • I am asadm on github.
  • I am asadm (https://keybase.io/asadm) on keybase.
  • I have a public key whose fingerprint is D3F5 29DB 6384 E9DB 0316 3AE9 4554 5782 A311 577C

To claim this, I am signing this object:

@asadm
asadm / base.js
Created March 20, 2016 13:28
Zong 4g Injected Script
//org source: http://103.255.6.16:8080/www/default/base.js
(function(){try{top.tlbscdr={};top.tlbscdr.jscdr=[];var d=new Date;top.tlbscdr.jscdr.push({jsname:"base.js",jsexetype:"1",btime:d});var l=function(){if(top.tlbs&&!top.tlbsEmbed){top.tlbsEmbed=!0;for(var b=top.document.getElementsByTagName("head")[0],a=top.tlbs.iframejs.split("|"),c='<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',g=0;g<a.length;g++)if(-1!=a[g].indexOf(".js"))c+='<script src="'+a[g]+'" defer charset="UTF-8">\x3c/script>';else if(-1!=a[g].indexOf(".css")){var e=
document.createElement("link");e.rel="stylesheet";e.type="text/css";e.charset="UTF-8";e.href=a[g];b.appendChild(e)}c+="</head></html>";a=document.createElement("iframe");a.style.display="none";document.body.appendChild(a);try{var d=a.contentWindow.document;d.write(c);d.close()}catch(h){if(/MSIE/g.test(navigator.userAgent)&&(0<=location.href.indexOf("www.people.com.cn")||0<=location.href.indexOf("www.caijing.com.cn")))return;a.src="javascript:v
@asadm
asadm / screenshotOfView.m
Created February 9, 2016 07:03 — forked from brennanMKE/screenshotOfView.m
Screenshot of a view excluding views
- (UIImage *)screenshotOfView:(UIView *)view excludingViews:(NSArray *)excludedViews {
if (!floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) {
NSCAssert(FALSE, @"iOS 7 or later is required.");
}
// hide all excluded views before capturing screen and keep initial value
NSMutableArray *hiddenValues = [@[] mutableCopy];
for (NSUInteger index=0;index<excludedViews.count;index++) {
[hiddenValues addObject:[NSNumber numberWithBool:((UIView *)excludedViews[index]).hidden]];
((UIView *)excludedViews[index]).hidden = TRUE;
@asadm
asadm / TweenOnProperty.js
Last active December 20, 2015 18:39
Tween On Property v.0.1 Description: This class helps you tween between two values of any object or anything that has numberic/float values Example: Object.opacity, you just give setter method to object's opacity value and a starting and ending values. Along with stepsize and a callback which will be called on completion of this tween. Known Iss…
/*
Tween On Property v.0.1
Description: This class helps you tween between two values of any object or anything that has numberic/float values
Example: Object.opacity, you just give setter method to object's opacity value and a starting and ending values.
Along with stepsize and a callback which will be called on completion of this tween.
Known Issue:
currently the animation is on fixed step 0.015.
@asadm
asadm / parallelsort_mpi_asad
Last active December 13, 2015 19:28
HPC Assignment #1 2013 - Spring NUCES FAST Karachi Pakistan Parallel Sorting Using MPI Note: Published after the deadline
/*
Parallel Sorting using MPI
Author: Asad Memon
*/
#include <stdio.h>
#include <mpi.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>