Skip to content

Instantly share code, notes, and snippets.

@dengue8830
dengue8830 / logger.ts
Created December 20, 2018 16:56
Logger wrapper for nodejs
import * as winston from 'winston';
import * as moment from 'moment';
const customLevels = {
levels: {
trace: 5,
debug: 4,
info: 3,
warn: 2,
error: 1,
@dengue8830
dengue8830 / Publish AAR to jCenter and Maven Central
Last active November 12, 2020 10:44 — forked from lopspower/README.md
Publish AAR to jCenter and Maven Central
Publish AAR to jCenter and Maven Central
=================
[![Twitter](https://img.shields.io/badge/Twitter-@LopezMikhael-blue.svg?style=flat)](http://twitter.com/lopezmikhael)
Now I'm going to list how to publish an Android libray to jCenter and then syncronize it with Maven Central:
1. I use "Android Studio" and I have this simple android lib that I would like to be available on maven: [CircularImageView](https://github.com/lopspower/CircularImageView)
2. In the library folder(module) I have the lib code abovementioned. And applying in the build.gradle of this folder `apply plugin: 'com.android.library'` I got as output an .aar in the build/outputs/aar/ directory of the module's directory
@dengue8830
dengue8830 / YourClass.swift
Created December 9, 2019 02:03
Apple swift ios sign in snippet
// At the top of the file
import AuthenticationServices
// ...
@objc
func appleSignIn(resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock) {
if #available(iOS 13.0, *) {
let appleIDProvider = ASAuthorizationAppleIDProvider()
let request = appleIDProvider.createRequest()
request.requestedScopes = [.fullName, .email]

Libs that i researched

sequelize-typescript | typeorm | knex | bookshelf | objection

Libs that i tested my self

sequelize-typescript | typeorm

Research

@dengue8830
dengue8830 / socket.ts
Created July 31, 2019 18:50
socket class to use in node server
import * as socketio from 'socket.io';
import { Server } from 'http';
import { logger } from '../../common/logger';
import { server } from '../../server';
/**
* Represents a socket server instance.
* This class wraps the final technology you will use to implements
* sockets, eg.: socket-io
*
@dengue8830
dengue8830 / AndroidManifest.xml
Created June 19, 2018 14:18
react-native-mauron85-background-geolocation+react-native-firebase+react-native-maps
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- RNFirebase notifications -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
@dengue8830
dengue8830 / Upgrade rn 57 -> 59
Created May 19, 2019 22:44
Upgrade rn 57 -> 59
#upgrade #rn #59
para pasar de la 57 a la 59
1) setear la version en package.json a la ultima de react y react native
2) rm -rf node_modules/
3) rm package-lock.json
ios
4) rm -rf ios/Pods
5) rm ios/Podfile.lock
@dengue8830
dengue8830 / android_app_build.gradle
Last active December 9, 2018 12:19
react-native-background-geolocation + firebase + react-native-maps
apply plugin: "com.android.application"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
@dengue8830
dengue8830 / http.ts
Created December 9, 2018 11:02
Http wrapper allow us changing the implementation and defining our custom http response/request interfaces
import axios, { AxiosInstance, AxiosPromise, AxiosRequestConfig } from 'axios';
import { ErrorExtra } from '../models/errores';
export class HttpError extends ErrorExtra {
status: HttpErrorCode;
constructor(status: HttpErrorCode, mensaje: string = '', extra?: any) {
super(mensaje, extra);
this.status = status;
// Esto quita este constructor del stacktrace pero solo esta disponible en node, no browsers
@dengue8830
dengue8830 / typescript.json
Last active November 24, 2018 02:42
vscode snippets
{
"Crea nuevo modelo": {
"prefix": "snpNuevoModelo",
"body": [
"import { Errores } from './errores';",
"",
"export interface I${1:}Attrs {",
" id?: string;",
" ${2:};",
"}",