Skip to content

Instantly share code, notes, and snippets.

View navarroaxel's full-sized avatar

Axel Navarro navarroaxel

View GitHub Profile
@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
################################################################################
################# 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 / 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';
// formThemeContext.js
const FormThemeContext = createContext({
radio: {},
textInput: {},
integerInput: {}
});
export default FormThemeContext;
export default class MegaValidator extends Validator {
constructor(validationLogic) {
super();
if (!isFunction(validationLogic)) {
throw new Error('Validator must have a method for validating.');
}
this.validationLogic = validationLogic;
}
forThis(entity) {
@navarroaxel
navarroaxel / index.js
Created March 19, 2018 14:43
redux-saga - takeLast
export default function* root() {
yield [
fork(fetchByParams)
]
<div ng-switch="$ctrl.resolve.chapterZero.homeOpenDoor">
<p ng-switch-when="1">La vivienda esta deshabitada</p>
<p ng-switch-when="16">El hogar abrió la puera, recibio material</p>
<p ng-switch-default>{{::$ctrl.resolve.chapterZero.homeOpenDoor}}</p>
</div>
const {reduce} = require('async');
this.sumColumn = function (rowsNumber, columnPosition,callback) {
var total = 0, value;
reduce(rowsNumber, 0, (acum, i) => {
browser.getText(ELEMENTS.ROW.locator + ':nth-child(' + i + ') td:nth-child(' + columnPosition + ')',
result => {
value = parseInt(JSON.stringify(result.value).replace(/\D/g, ''));
callback(null, acum + (value || 0));
console.log('counting... '+acum);
#!/bin/sh
#husky 0.13.1
command_exists () {
command -v "$1" >/dev/null 2>&1
}
load_nvm () {
export $1=$2
[ -s "$1/nvm.sh" ] && . $1/nvm.sh
/*@ngInject*/
export default function pingService($http, endpoint) {
return {
ping: () => $http.get(`${endpoint}ping`).then(response => response.data)
};
}