Skip to content

Instantly share code, notes, and snippets.

View jpillora's full-sized avatar
👶

Jaime Pillora jpillora

👶
View GitHub Profile
@jpillora
jpillora / http-btn.js
Created March 12, 2019 14:52
Random Vue Stuff
import defaults from "lodash.defaults";
let httpBtn = {
bind: (el, binding) => {
//get options (evald expression)
let opts = binding.value;
if (typeof opts === "function") {
opts = {fn: opts};
}
//provide defaults
@jpillora
jpillora / _README.md
Created October 11, 2018 14:26
Export 28degress master card transactions to CSV

export-28deg.js

Export 28degress master card transactions to CSV

  1. Visit 28 degress transactions page
  2. Open Developer Console
  3. Paste code
  4. Press enter
@jpillora
jpillora / rdiff-example.sh
Created July 6, 2017 06:41
rdiff file example
# $ apt install rdiff
# $ rdiff --help
# Usage: rdiff [OPTIONS] signature [BASIS [SIGNATURE]]
# [OPTIONS] delta SIGNATURE [NEWFILE [DELTA]]
# [OPTIONS] patch BASIS [DELTA [NEWFILE]]
# Options:
# -v, --verbose Trace internal processing
# -V, --version Show program version
# -?, --help Show this help message
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org
mQENBFOraBABCACwTSt0zrIvHgKQVigkukGghPy+04IbIZPSjALucermep/qQij5
RDkXEgNulSceHJp7cAfm48QLXgC7mxNTqLRX/dW6HpErHVjH/3JffITZW/rCIeEA
ULAj2b/7N/e7VpcujhotH0m8g/jVCOiX+f+LxHJNYEW734+DUe3qcorbKWSHTR1t
2WY5oOxd//4F+0CYCcy+8Jkl6lv//Yz/7EHNUEHp/If+TiIEf2gnfI08Qlbfefz1
n7MUk0ixSrfF8cxmQ8YBOstp/ruQD0lD7Qz1/K9Z10U9Fmlvtq5cj3M70QCI+Qn+
Fcr+6lnltqR5l4OBqYeJ6+kwQbMCtaSwdWjdABEBAAG0IkphaW1lIFBpbGxvcmEg
PGpwaWxsb3JhQGdtYWlsLmNvbT6JAT0EEwEKACcFAlOraBACGwMFCQeGH4AFCwkI
@jpillora
jpillora / s3get.sh
Last active August 23, 2023 12:07
S3 signed GET in plain bash (Requires openssl and curl)
#!/bin/bash
#set these in your environment/profile (NOT HERE)
AWS_ACCESS_KEY=""
AWS_SECRET_KEY=""
function s3get {
#helper functions
function fail { echo "$1" > /dev/stderr; exit 1; }
#dependency check
@jpillora
jpillora / tomp3
Created October 16, 2016 05:15
Concatenate multiple MP3s into a single MP3
#!/bin/bash
# concat multiple mp3 files into a single mp3
# installation:
# chmod +x tomp3 and save to /usr/local/bin/tomp3
# usage: tomp3 <DIR> [NAME]
# finds all mp3 files in DIR, writes a single mp3 to NAME.mp3
# set NAME to --preview to list mp3s in the order they will
# be concatenated.
# requires: ffmpeg
@jpillora
jpillora / install-tm.sh
Last active November 28, 2018 13:12
tmux helper
#tmux helper
echo '#!/bin/bash
NAME="${1}"
if [[ "$NAME" = "" ]]; then
tmux ls
else
tmux attach-session -t "$NAME" || tmux new-session -s "$NAME"
fi' > /usr/local/bin/tm &&
chmod +x /usr/local/bin/tm
@jpillora
jpillora / install-micro.sh
Last active September 15, 2018 15:39
install micro text editor from https://github.com/zyedidia/micro/releases
#!/bin/bash
#os check
case `uname -s` in
Darwin) OS="osx";;
Linux) OS="linux64";;
*) echo "unknown os: $(uname -s)" && exit 1;;
esac
#version check
echo -n "checking latest version... "
VER=`curl -sI https://github.com/zyedidia/micro/releases/latest | grep Location | sed "s~^.*tag\/v~~" | tr -d '\n' | tr -d '\r'`
@jpillora
jpillora / unix-to-tcp.go
Last active April 10, 2024 00:55
Forward unix socket to tcp socket
package main
import (
"io"
"log"
"net"
"os"
)
const (
@jpillora
jpillora / xero-api.go
Created April 27, 2016 02:02
Xero API for Private applications in Go (golang)
package main
import (
"crypto/x509"
"encoding/pem"
"fmt"
"io/ioutil"
"log"
"net/http"