Skip to content

Instantly share code, notes, and snippets.

View ichadhr's full-sized avatar
Focusing

Chad ichadhr

Focusing
View GitHub Profile
@ichadhr
ichadhr / roo_workflow.md
Created August 4, 2025 17:32 — forked from livecodelife/roo_workflow.md
Roo Code Setup and Workflow for the best $0 development

Roo Code Workflow: An Advanced LLM-Powered Development Setup

This gist outlines a highly effective and cost-optimized workflow for software development using Roo Code, leveraging a multi-model approach. This setup has been successfully used to build working applications, such as Baccarat game simulations with betting strategy analysis, and my personal portfolio site.


Core Components & Model Allocation

The power of this setup lies in strategically assigning different Large Language Models (LLMs) to specialized "modes" within Roo Code, optimizing for performance, cost, and specific task requirements.

  1. What is the output of the following code:
$a = '1';
$b = &$a;
$b = "2$b";
echo $a.", ".$b;
  1. What is the difference between $_GET and $_POST?
  2. What does the isset() function mean?
@ichadhr
ichadhr / Test.md
Last active September 24, 2021 07:40
  1. What is the output of the following code:
$a = '1';
$b = &$a;
$b = "2$b";
echo $a.", ".$b;
  1. What is the difference between $_GET and $_POST?
  2. What does the isset() function mean?
@ichadhr
ichadhr / Test.md
Created September 21, 2021 02:21
  1. What is the output of the following code:
$a = '1';
$b = &$a;
$b = "2$b";
echo $a.", ".$b;
  1. What is the difference between $_GET and $_POST?
  2. What does the isset() function mean?
  3. Convert bellow conditional statements to ternary conditional operator?
@ichadhr
ichadhr / create-efi-keys.sh
Created October 22, 2020 11:59 — forked from Era-Dorta/create-efi-keys.sh
Sign kernel modules on Ubuntu, useful for Nvidia drivers in UEFI system
# VERY IMPORTANT! After each kernel update or dkms rebuild the modules must be signed again with the script
# ~/.ssl/sign-all-modules.sh
# Place all files in ~/.ssl folder
mkdir ~/.ssl
cd ~/.ssl
# Generate custom keys with openssl
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -subj "/CN=Owner/"
@ichadhr
ichadhr / FileDownload.cs
Last active January 23, 2020 20:41
C# File Download
public class FileDownload {
private volatile bool _completed;
public void DownloadFile(string address, string location) {
using(WebClient client = new WebClient()) {
Uri Uri = new Uri(address);
_completed = false;
client.DownloadFileCompleted += new System.ComponentModel.AsyncCompletedEventHandler(Completed);
@ichadhr
ichadhr / FindRealtedTable.sql
Created November 11, 2019 05:37
Find Realted Table SQL
SELECT
c.CONSTRAINT_NAME,
cu.TABLE_NAME AS ReferencingTable, cu.COLUMN_NAME AS ReferencingColumn,
ku.TABLE_NAME AS ReferencedTable, ku.COLUMN_NAME AS ReferencedColumn
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS c
INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE cu
ON cu.CONSTRAINT_NAME = c.CONSTRAINT_NAME
INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE ku
ON ku.CONSTRAINT_NAME = c.UNIQUE_CONSTRAINT_NAME
WHERE ku.TABLE_NAME = 'FOO'
@ichadhr
ichadhr / PercentRounder.cs
Created October 23, 2019 07:24 — forked from dochoffiday/PercentRounder.cs
Uses the "Largest Remainder Method" to ensure rounded percentages add up to their correct total
using System;
using System.Collections.Generic;
using System.Linq;
public class PercentRounder
{
public class PercentInfo
{
public int Index;
public int Percent;
function in_array_r($needle, $haystack, $strict = false) {
foreach ($haystack as $item) {
if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) {
return true;
}
}
return false;
}
// sample
```php
$array=[
['day'=>'11','movements'=>'1'],
['day'=>'11','movements'=>'1'],
['day'=>'11','movements'=>'1'],
['day'=>'12','movements'=>'1'],
['day'=>'12','movements'=>'1'],
['day'=>'12','movements'=>'1']
];
foreach($array as $row){ // iterate all rows