Skip to content

Instantly share code, notes, and snippets.

View navarroaxel's full-sized avatar

Axel Navarro navarroaxel

View GitHub Profile
// formThemeContext.js
const FormThemeContext = createContext({
radio: {},
textInput: {},
integerInput: {}
});
export default FormThemeContext;
@navarroaxel
navarroaxel / ssb-interop.js
Created November 7, 2018 14:39
Slack dark theme
// paste into /usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js
// First make sure the wrapper app is loaded
document.addEventListener("DOMContentLoaded", function() {
// Then get its webviews
let webviews = document.querySelectorAll(".TeamView webview");
// Fetch our CSS in parallel ahead of time
const cssPath = 'https://cdn.rawgit.com/widget-/slack-black-theme/master/custom.css';
################################################################################
################# Arch Linux mirrorlist generated by Reflector #################
################################################################################
# With: reflector --sort rate --latest 10 --save /etc/pacman.d/mirrorlist
# When: 2019-04-28 02:12:34 UTC
# From: https://www.archlinux.org/mirrors/status/json/
# Retrieved: 2019-04-28 02:12:24 UTC
# Last Check: 2019-04-28 02:07:41 UTC
@navarroaxel
navarroaxel / ps1.sh
Created October 23, 2019 18:59
PS1 with git
#!/usr/bin/env bash
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
const runSql = (connection, sqlText) => new Promise((resolve, reject) => {
connection.execute({
sqlText,
complete: (err, stmt, rows) => {
if (err) {
reject(err);
return;
}
resolve(rows);
}
@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')
@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 / 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')
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 / 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