Skip to content

Instantly share code, notes, and snippets.

View bipoza's full-sized avatar
📱

Bittor Poza bipoza

📱
View GitHub Profile
@bipoza
bipoza / Rendering hyperlinks from HTML strings in Ionic 4 and Angular
Created January 8, 2020 12:33
Rendering hyperlinks from HTML strings in Ionic 4 and Angular
@sketchbuch
sketchbuch / jest-mock-usehistory-hook.ts
Last active March 29, 2023 13:12
TESTING - Jest mock useHistory hook for a test
// Imports go here... no need to import react-router-dom
jest.mock('react-router-dom', () => ({
useHistory: () => ({ push: jest.fn() }),
}))
// describe(), test() etc go here...
@bipoza
bipoza / token.interceptor.ts
Created July 28, 2020 08:29 — forked from danielcrisp/token.interceptor.ts
TokenInterceptor - Async HTTP Interceptors with Angular 4
import { Injectable } from '@angular/core';
import { HttpErrorResponse, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/mergeMap';
import { AuthService } from './auth.service';
@Injectable()
export class TokenInterceptor implements HttpInterceptor {
@dcatanzaro
dcatanzaro / widget.js
Last active February 14, 2025 23:21
Widget iOS: Feriados Argentina
//Twitter: @DamianCatanzaro
const widget = await createWidget();
if (config.runsInWidget) {
Script.setWidget(widget);
Script.complete();
} else {
widget.presentLarge();
}
@usametov
usametov / topics-search.txt
Created February 16, 2021 01:50
how to search github.com for multiple topics
Github.com ui .currently does not natively supoport search for multiple topic tags as of now. However their api allows you to query multiple tags. Below is a simple example to query github.com with ecs and go topic tags.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories?q=topic:ecs+topic:go
Response from the github can be rather verbose so lets filter only relavant info such repo url and description.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories\?q\=topic:ecs+topic:go | jq '.items[] | {url:.url, description:.description}'
#!/usr/bin/python3.7
from git import Actor
from git import Repo
import datetime
import os
import time
import json
import requests
@JaimeObregon
JaimeObregon / appspublicas.txt
Last active May 31, 2021 19:58
Nombre de más de 500 apps desarrolladas por organismos públicos.
010 ACCESIBLE - Ayuntamiento de Murcia
061 Salut Respon
100 Horas de Deporte
112 Andalucía
112-SOS Deiak
14F Elecciones Cataluña
4M Elecciones Madrid 2021
A.P. Santander
ACÁ Andalucía Comercio y Artesanía
Adif
#! /usr/bin/env python
# -*- coding: utf-8 -*-
""" install pdftoppm first (use your package manager) """
import os
def main(start="."):
for dirpath, dirnames, filenames in os.walk(start):
for filename in filenames:
if filename.endswith('pdf') and not filename.startswith('.') and f'{filename}.jpg' not in filenames:
os.system(f'pdftoppm -jpeg -f 1 -l 1 "{dirpath}/{filename}" > "{dirpath}/{filename}.jpg"')