Skip to content

Instantly share code, notes, and snippets.

View aescarcha's full-sized avatar

Álvaro Escarcha aescarcha

View GitHub Profile
@aescarcha
aescarcha / reddit_fetch.py
Created November 10, 2026 17:05
reddit_fetch.py: read-only Reddit reader for a solo iOS developer's personal review queue (never posts, comments, votes or messages)
#!/usr/bin/env python3
"""
Read-only Reddit fetcher for the promo scan (skill: reddit-promo).
Uses the logged-in cookie session from app-store-research/.env.local
(REDDIT_COOKIE + REDDIT_USER_AGENT, read with a regex — never `source`d, never
printed). Honours Reddit's per-window budget (~100 requests): waits for
x-ratelimit-reset when remaining < 3 or on HTTP 429, retries one network error.
reddit_fetch.py thread <post url> [<post url> ...] [--comments 15] # post + top comments, 1 request each
@aescarcha
aescarcha / gist:341db9d36ccff444b8ad1368e2c834c2
Last active November 26, 2021 16:36
Inversify double controller inheritance failing test
import {Container, injectable} from 'inversify';
import * as supertest from 'supertest';
import {json, urlencoded} from 'express';
import {InversifyExpressServer} from '../../src/server';
import {
controller, httpGet, requestParam,
httpDelete, httpPost, httpPut, requestBody,
} from '../../src/decorators';
import {cleanUpMetadata} from '../../src/utils';
import {getRouteInfo} from '../../src';
@aescarcha
aescarcha / example.ts
Last active October 9, 2018 11:49
Browser image downscaling on Typescript with Angular example
// Example of picking a file and using this
// Angular + material, you can go to handleInput
<button type="button" mat-raised-button color="primary" (click)="fileInput.click()">
<span>Sube tu foto</span>
<input #fileInput type="file" (change)="handleFileInput($event)" style="display:none;" />
</button>
@aescarcha
aescarcha / nodeAsyncTest.js
Created September 25, 2018 07:03
Javascript async / await resolving promises at the same time test
// Simple gist to test parallel promise resolution when using async / await
function promiseWait(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(true);
}, time);
});
}