Skip to content

Instantly share code, notes, and snippets.

View paulonteri's full-sized avatar
💻
Building

Paul Onteri paulonteri

💻
Building
View GitHub Profile
@paulonteri
paulonteri / .gitlab-ci.yml
Created May 22, 2021 07:52 — forked from illuzor/.gitlab-ci.yml
Config for gitlab ci android with unit tests and instrumented tests
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "29"
ANDROID_BUILD_TOOLS: "29.0.3"
SDK_TOOLS: "6200805" # from https://developer.android.com/studio/#command-tools
EMULATOR_VERSION: "24"
before_script:
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/commandlinetools-linux-${SDK_TOOLS}_latest.zip
@paulonteri
paulonteri / drf_utils.py
Created April 20, 2021 19:44 — forked from twidi/drf_utils.py
Make Django Rest Framework correctly handle Django ValidationError raised in the save method of a model
"""
Sometimes in your Django model you want to raise a ``ValidationError`` in the ``save`` method, for
some reason.
This exception is not managed by Django Rest Framework because it occurs after its validation
process. So at the end, you'll have a 500.
Correcting this is as simple as overriding the exception handler, by converting the Django
``ValidationError`` to a DRF one.
"""
from django.core.exceptions import ValidationError as DjangoValidationError
@paulonteri
paulonteri / 00.install-android-sdk.sh
Last active February 11, 2021 17:20 — forked from nhtua/00.install-android-sdk.sh
Run a Headless Android Device on Ubuntu server (no GUI)
#!/bin/bash -i
#using shebang with -i to enable interactive mode (auto load .bashrc)
set -e #stop immediately if any error happens
# Install Open SDK
apt update
apt install openjdk-8-jdk -y
update-java-alternatives --set java-1.8.0-openjdk-amd64
java -version
@paulonteri
paulonteri / filterArray.js
Created February 8, 2021 02:39 — forked from jherax/arrayFilterFactory.1.ts
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects using custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {
@paulonteri
paulonteri / sampleREADME.md
Created September 15, 2020 14:33 — forked from FrancesCoronel/sampleREADME.md
A sample README for all your GitHub projects.

FVCproductions

INSERT GRAPHIC HERE (include hyperlink in image)

Repository Title Goes Here

Subtitle or Short Description Goes Here

import signal
import sys
import asyncio
import aiohttp
import json
loop = asyncio.get_event_loop()
client = aiohttp.ClientSession(loop=loop)
async def get_json(client, url):
git clone https://github.com/fastai/fastai
cd fastai
conda create -n fastai python=3.6 anaconda
conda env update
# bash include source
# windows no source
@paulonteri
paulonteri / east&southernafricamosquitoes.ipynb
Created April 22, 2019 06:58 — forked from itsmuriuki/east&southernafricamosquitoes.ipynb
East and South African Mosquito classifier: This notebook has images of mosquitoes of three species which are prevalent in the areas mentioned and could be carriers of the parasite Plasmodium in their salivary glands which is the causative agent of malaria.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.