Skip to content

Instantly share code, notes, and snippets.

View iaurg's full-sized avatar
☣️
Extreme Programming and Challenges

Italo A. iaurg

☣️
Extreme Programming and Challenges
View GitHub Profile
@iamnolanhu
iamnolanhu / CHATGPT VERSION (GPT-4 | GPT-4.1)
Created June 18, 2025 13:39
REALITY FILTER — A LIGHTWEIGHT TOOL TO REDUCE LLM FICTION WITHOUT PROMISING PERFECTION
✅ REALITY FILTER — CHATGPT
• Never present generated, inferred, speculated, or deduced content as fact.
• If you cannot verify something directly, say:
- “I cannot verify this.”
- “I do not have access to that information.”
- “My knowledge base does not contain that.”
• Label unverified content at the start of a sentence:
- [Inference] [Speculation] [Unverified]
• Ask for clarification if information is missing. Do not guess or fill gaps.
---
description:
globs: spec/**/*
alwaysApply: false
---
# RSpec Testing Guidelines
## Core Principles
- Use RSpec for all tests
- Use FactoryBot for test data
@sibelius
sibelius / apiLog.ts
Created April 13, 2021 15:01
fetch api with log
export const apiWithLog = (init, options) => {
const end = timeSpan();
return fetch(init, options).then(async (response) => {
const durationTime = end();
const text = await response.text();
let json;
try {
@sibelius
sibelius / testingConcept.md
Last active February 1, 2024 17:36
testing library concept and basic test

You first need to undestand the concept of frontend tests.

You should not test the implementation but the behavior

You test like the end user

For instance, imagine a login screen with email and password inputs and a submit button

The test should input the email and the password, then click in the submit button.

@jbranchaud
jbranchaud / switch_pg_server_client_versions.bash
Last active January 15, 2025 00:22
Bash function for switching asdf postgres versions and stopping/starting servers
function switch_pg {
local version_to_run=$1
local currently_running_version=$(psql --no-psqlrc -t -c 'show server_version;' postgres | xargs)
# check if you're erroneously switching to the same version
if [ "$version_to_run" = "$currently_running_version" ]; then
echo "Postgres $version_to_run is already running."
return 1
fi
@lrvick
lrvick / github-troll.md
Last active May 24, 2025 01:11
Trolling Github's DMCA repo with their own security flaws.
@sibelius
sibelius / FeatureFlag.tsx
Created May 6, 2020 12:33
Basic Feature Flag implementation using React.Context
import React, { useContext, useCallback } from 'react';
export const FeatureFlagContext = React.createContext<string[]>([]);
export const useFeatureFlag = () => {
const features = useContext<string[]>(FeatureFlagContext);
const hasFeature = useCallback(
(feature: string) => {
return features.includes(feature);
@sibelius
sibelius / webpack.config.js
Created February 5, 2020 15:33
current webpack config
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const dotEnv = require('dotenv-webpack');
const HappyPack = require('happypack');
const Serve = require('webpack-plugin-serve');
const workboxPlugin = require('workbox-webpack-plugin');
const PORT = process.env.PORT;
@akitaonrails
akitaonrails / links.md
Created November 6, 2019 01:28
Links de referência pro Episódio 66 do Canal Akitando