Skip to content

Instantly share code, notes, and snippets.

View navarroaxel's full-sized avatar

Axel Navarro navarroaxel

View GitHub Profile
FROM node:slim
# We don't need the standalone Chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
# Install Google Chrome Stable and fonts
# Note: this installs the necessary libs to make the browser work with Puppeteer.
RUN apt-get update && apt-get install gnupg wget -y && \
wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
function getDv(partida) {
partida = new String(partida);
var a = new Array(7);
var i;
for (i = 0; i < 7; a[i++] = "0"); // cargo el arreglo con ceros
for (i = partida.length - 1, j = 0; i >= 0; i--, j++)
a[a.length - 1 - j] = partida.charAt(i);// el array esta en sentido inverso
var dv = new String((a[6] * 7 + a[5] * 6 + a[4] * 5 + a[3] * 4 + a[2] * 3 + a[1] * 2 + a[0] * 7) % 11);
diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..0ff66f3 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -275,6 +275,8 @@ - (void)displayLayer:(CALayer *)layer
if (_currentFrame) {
layer.contentsScale = self.animatedImageScale;
layer.contents = (__bridge id)_currentFrame.CGImage;
+ } else {
+ [super displayLayer:layer];
const save = (surveys = [], user) => {
const promises = surveys.map(async (survey) => {
const {user: currentUser} = await this.knex
.select('user')
.from('addresses')
.where({
user: user.id,
id: survey.address,
})
.first();
@navarroaxel
navarroaxel / ProfileAvatar.js
Last active November 19, 2020 12:32
ProfileAvatar 2 letters
import React from 'react';
import {Avatar} from 'react-native-elements';
import {useSourceUri, useThemedStyles} from '@staks/react-native-commons';
import createStyles from './styles';
import LinearGradient from 'react-native-linear-gradient';
import {Text, View} from 'react-native';
const getLetters = (text) => {
const words = text.split(' ').filter((x) => x);
return words.length === 1
const uploadPicture = async (staksName, uri) => {
const body = new FormData();
body.append('file', {uri, type: 'application/octet-stream', name: 'file'});
const response = await fetch('https://postman-echo.com/post', {
body,
method: 'POST',
accept: 'application/json',
'Content-Type': 'multipart/form-data',
});
const data = await response.json();
@navarroaxel
navarroaxel / git-delta_PKGBUILD
Last active July 23, 2020 02:10
Arch Linux PKGBUILD for delta --hyperlinks
pkgname=git-delta
_name="${pkgname#*-}"
pkgver=0.3.0
pkgrel=3
pkgdesc='A syntax-highlighting pager for git and diff output'
arch=('i686' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64')
url="https://github.com/dandavison/$_name"
license=('MIT')
@navarroaxel
navarroaxel / index.js
Created February 5, 2020 20:15
Prerender + proxy
const app = express()
app.use(require('prerender-node').set('prerenderServiceUrl', 'http://service.prerender.io'));
app.use(require('proxy'));
app.listen(3000);
@navarroaxel
navarroaxel / PKGBUILD
Created January 27, 2020 11:25
[Archlinux] override latte-dock v0.9.8 with v0.9.8.1
pkgname=latte-dock
pkgver=0.9.8
_pkgver=0.9.8.1
pkgrel=1
pkgdesc='Latte is a dock based on plasma frameworks that provides an elegant and intuitive experience for your tasks and plasmoids'
arch=('i686' 'x86_64')
url='https://cgit.kde.org/latte-dock.git/'
license=('GPL')
depends=('plasma-framework' 'plasma-desktop')
optdepends=('libunity: quicklists, counters, and progress bars for apps using libunity')
const runSql = (connection, sqlText) => new Promise((resolve, reject) => {
connection.execute({
sqlText,
complete: (err, stmt, rows) => {
if (err) {
reject(err);
return;
}
resolve(rows);
}