Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

David Rearte dengue8830

🎯
Focusing
View GitHub Profile
@dengue8830
dengue8830 / YourClass.swift
Created Dec 9, 2019
Apple swift ios sign in snippet
View YourClass.swift
// 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]
View nodejs-orm-research.md

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 Jul 31, 2019
socket class to use in node server
View socket.ts
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
*
View 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 / logger.ts
Created Dec 20, 2018
Logger wrapper for nodejs
View logger.ts
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 / android_app_build.gradle
Last active Dec 9, 2018
react-native-background-geolocation + firebase + react-native-maps
View android_app_build.gradle
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 Dec 9, 2018
Http wrapper allow us changing the implementation and defining our custom http response/request interfaces
View http.ts
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
View typescript.json
{
"Crea nuevo modelo": {
"prefix": "snpNuevoModelo",
"body": [
"import { Errores } from './errores';",
"",
"export interface I${1:}Attrs {",
" id?: string;",
" ${2:};",
"}",
View templates-react-native.md
@dengue8830
dengue8830 / instalar-java-linux.md
Last active Jul 13, 2018
Para instalar java en distros basadas en linux (desactualizado pero vale)
View instalar-java-linux.md
You can’t perform that action at this time.