Skip to content

Instantly share code, notes, and snippets.

View FagnerMartinsBrack's full-sized avatar
🎯
Focusing

Fayner Brack FagnerMartinsBrack

🎯
Focusing
View GitHub Profile
@FagnerMartinsBrack
FagnerMartinsBrack / check-axios-compromise.sh
Created April 1, 2026 11:03
Check If You're Compromised by the Axios Attack (MacOS only)
#!/bin/bash
#
# Checks for the axios npm supply chain attack (CVE-2025-XXXXX)
# Compromised versions: axios@1.14.1, axios@0.30.4
# Malicious dependency: plain-crypto-js@4.2.1
# macOS RAT artifact: /Library/Caches/com.apple.act.mond
#
# Source: https://www.aikido.dev/blog/axios-npm-compromised-maintainer-hijacked-rat
#
# Usage: ./check-axios-compromise.sh [search_root]
@FagnerMartinsBrack
FagnerMartinsBrack / IBM 5100 Portable Computer Transformed Scientific Computing in 1975.md History of Computational Intelligence and WHY THEY kept LOSING IT because IT was ALWAYS reverse engineered from the start!

https://claude.ai/public/artifacts/9d0ac357-ed87-44c1-ad0c-2a9237c0bc46

The IBM 5100 portable computer transformed scientific computing in 1975

The IBM 5100 represented a breakthrough in portable professional computing when launched in September 1975, compressing mainframe-level programming capabilities into a 55-pound "luggable" computer priced between $8,975 and $19,975 (equivalent to $52,000-$117,000 today). This revolutionary system bridged the gap between room-sized mainframes and the personal computer revolution, serving specialized markets in government, research, and business sectors through its unique combination of APL and BASIC programming languages previously available only on much larger systems. Despite limited commercial success with relatively small production numbers before its discontinuation in March 1982, the 5100 established crucial technical precedents for portable computing and demonstrated IBM's early recognition of single-user computing potential. The system's legacy extends beyond

@FagnerMartinsBrack
FagnerMartinsBrack / CodeForEvolvableAPIUsingCLI.js
Last active February 5, 2019 10:34
(Medium) - Evolvable APIs
// The brains to fill the fields. This uses the human brain of the user.
const usingCLI = (fields) => {
const fieldsWithValuesFromUser = await presentFieldNamesToUser(Object.keys(fields));
return fieldsWithValuesFromUser;
};
// The client uses the CLI to get the field values when the server asks for it
const runWithFieldsFromCLI = run(usingCLI);
// Initial trigger of the booking process
@FagnerMartinsBrack
FagnerMartinsBrack / ClientCodeForEvolvableAPI.js
Last active April 14, 2019 04:09
(Medium) - Evolvable APIs
// The brains to fill the fields. This can use AI, etc.
const fillFields = (fields) => fields;
const run = async (method = 'GET', url = 'https://clinic.example.com/start-booking', fields) => {
const response = await fetch(url, { method: method, body: JSON.stringify(fields) });
const parsedResponseBody = await response.json();
const requiredFieldsAction = queryAction('required-fields', parsedResponseBody);
if (requiredFieldsAction) {
@FagnerMartinsBrack
FagnerMartinsBrack / EvolvableAPIForAppointmentSystem.json
Last active February 13, 2019 22:03
(Medium) - Evolvable APIs
// Response for:
// GET /start-booking
{
"data": [{
"type": "action",
"id": "required-fields",
"attributes": {
"url": "/start-booking",
"method": "post",
@FagnerMartinsBrack
FagnerMartinsBrack / SecondRequirementTraditionalWay.js
Last active February 3, 2019 03:01
(Medium) - Evolvable APIs
const response = await fetch('http://clinic.example.com/booking?intendedDoctor=jane', {
method: 'get'
});
const availableTimeSlotsForTheWeek = await response.json();
await fetch('http://clinic.example.com/booking', {
method: 'post',
body: JSON.stringify({
username: 'mary.doe',
@FagnerMartinsBrack
FagnerMartinsBrack / CreateBookingTraditionalWay.js
Last active February 3, 2019 02:57
(Medium) - Evolvable APIs
await fetch('http://clinic.example.com/booking', {
method: 'post',
body: JSON.stringify({
username: 'mary.doe',
dateTime: '2018-05-01T10:20:00Z'
intendedDoctor: 'jane',
booking: 'Consultation with Doctor Jane'
}),
});
@FagnerMartinsBrack
FagnerMartinsBrack / ExampleImportCoupling.js
Created December 17, 2018 10:44
(Medium) - The Myth Of 100% Code Coverage
const prefill = Prefill(StubbedProvider())(MappingLogic(forSimpleMatching));
const prefilledFormFields = prefill(FormFields());
expect(prefilledFormFields.toString()).toEqual('name: Anna');
@FagnerMartinsBrack
FagnerMartinsBrack / ExampleIsolateSideEffects.js
Created December 17, 2018 10:43
(Medium) - The Myth Of 100% Code Coverage
const httpServerDataSource = HttpServerDataSource(getRequest);
const postsTitle = await httpServerDataSource.findPostsTitle();
assert.deepEqual(postsTitle, ['How to bake a cake']);
@FagnerMartinsBrack
FagnerMartinsBrack / ReactTestRenderedComponent.js
Created December 17, 2018 10:41
(Medium) - The Myth Of 100% Code Coverage
const renderedComponent = render(<Counter></Counter>);
renderedComponent.querySelector('.count-button').click();
renderedComponent.querySelector('.count-button').click();
const renderedCount = renderedComponent
.querySelector('.current-count')
.innerHTML;
expect(renderedCount).toEqual('2');