Skip to content

Instantly share code, notes, and snippets.

View posva's full-sized avatar
🙏
sponsor me on GitHub

Eduardo San Martin Morote posva

🙏
sponsor me on GitHub
View GitHub Profile
@posva
posva / multiple-app-pinia.html
Created June 30, 2021 13:07
Example of Pinia being shared across two Vue 3 apps
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Two Vue Apps, One Pinia</title>
</head>
<body>
<script src="https://unpkg.com/vue@3.1.2/dist/vue.global.js"></script>
@posva
posva / config.yml
Last active May 2, 2020 22:59
Simple Circle CI 2 config for node/js projects
# Javascript Node 8 simple CircleCI 2.0 configuration file
# Eduardo San Martin Morote
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
# Put this file in a .circleci/ folder
version: 2
jobs:
build:
docker:

Keybase proof

I hereby claim:

  • I am posva on github.
  • I am posva (https://keybase.io/posva) on keybase.
  • I have a public key whose fingerprint is F92A 0A3D 8D7F 3C01 AEBD E539 59AF 6DFC 8A56 282D

To claim this, I am signing this object:

Install the needed packages

npm i --save-dev nightwatch selenium-server chromedriver

Create a e2e-tests dir:

mkdir e2e-tests
@posva
posva / tmux_local_install.sh
Created October 17, 2014 12:25
Install tmux without root rights. Fixed from https://gist.github.com/ryin/3106801
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.9
@posva
posva / lines.sh
Created September 2, 2014 14:09
Generates a dirtree (LaTex) view with line count
#! /bin/bash
L=$(echo index_a6_se_ast.html index_a6_se_tst.html js_a6_se_ast/*.js js_a6_se_tst/*.js js/lib/qtBinding.js js/lib/nuntius.js js_a6_se_tst/css/main.css json/README.md json/genjs.sh json/genjson.py json/a6JSONValidator.js)
N=$(cat $L | wc -l)
echo "Total $N"
old=''
for i in $L; do
T=$(wc -l $i)
lines=$(echo "$T" | cut -d " " -f1)
@posva
posva / watcher.sh
Created August 22, 2014 14:50
Watch for files changes
#! /bin/sh
WHEN=$(stat -c "%Y" report.tex)
while true; do
NOW=$(stat -c "%Y" report.tex)
if [ "$NOW" -gt "$WHEN" ]; then
make
fi
WHEN="$NOW"
sleep 1
@posva
posva / fancy-header.vim
Created August 17, 2014 16:13
Use Ctr+H to add the classic header with defines guards for C/C++ files
" fill rest of line with characters
function! FillLine( str, l )
" strip trailing spaces first
.s/[[:space:]]*$//
" calculate total number of 'str's to insert
let reps = (a:l - col("$")) / len(a:str)
" insert them, if there's room, removing
" trailing spaces (though forcing
" there to be one)
if reps > 0
@posva
posva / diff.js
Created August 14, 2014 13:31
Advanced diff between arrays
var diff = function(a, b) {
var c = [], dels = [], delsIndex = [];
var i = 0, j = 0, k,
x, y, z;
var t = 0; //debug
while (i < a.length || j < b.length) {
x = a[i];
y = b[j];
t++;
@posva
posva / tmux.conf
Created July 28, 2014 19:55
Some conf I need to edit
set-window-option -g utf8 on
set-window-option -g mode-keys vi
set -s escape-time 0
setw -g window-status-current-attr underscore
set-option -g default-terminal "screen-256color"
set-option -g status-interval 5
set -g pane-active-border-fg white