Skip to content

Instantly share code, notes, and snippets.

View eloyesp's full-sized avatar

Eloy Espinaco eloyesp

View GitHub Profile
@eloyesp
eloyesp / compare
Created September 12, 2024 14:52
Compare BTC to USDT swap price (FixedFloat, ThorChain, Maya)
#!/bin/bash
# Get quotes for FixedFloat, Thorchain and Mayachain
#
# Usage compare [amount]
# amount expressed in BTC (defaults to 0.01 BTC)
#
# Requirements: jq httpie bc
# set -x
set -e
@eloyesp
eloyesp / opensslupdate.diff
Created April 17, 2024 13:06
Patch for Ruby v2.3.8 with compatibility with OpenSSL 1.1
diff --git a/ext/openssl/History.md b/ext/openssl/History.md
new file mode 100644
index 0000000000..029426fb8c
--- /dev/null
+++ b/ext/openssl/History.md
@@ -0,0 +1,137 @@
+Version 2.0.0
+=============
+
+This is the first release of openssl gem, formerly a standard library of Ruby,
@eloyesp
eloyesp / form.liquid
Created May 31, 2023 14:21
Shopify skip filters when all match
{%- liquid
# skip filters where all match
assign skip_filter = true
for value in filter.values
unless value.count == collection.products_count
assign skip_filter = false
break
endunless
endfor
if skip_filter
@eloyesp
eloyesp / fix_themes.bash
Created November 9, 2022 14:39
Apply changes to several themes
#!/bin/bash
set -e # exit
# set -x # trace
# trap "set +x; read; set -x;" debug
for THEME in (shopify theme list output edited here)
do
git checkout -B bfcm us-live
@eloyesp
eloyesp / pseudobash.sh
Created May 17, 2022 16:06
Cleanup a branch from layouthub
# generate the diff
git diff --stat main > to_clean.stat
# remove everything you want to KEEP
vim to_clean.stat
# Filter
git filter-branch --index-filter "cat $(pwd)/to_clean.stat |
xargs git rm --cached --ignore-unmatch" \
main..HEAD
@eloyesp
eloyesp / input.scss
Created November 11, 2021 10:06
Generated by SassMeister.com.
@mixin respond-to($class) {
@media only screen and (max-width: $class) {
@content;
}
}
@mixin flex-wrap($value: nowrap) {
flex-wrap: $value;
}
@mixin flexbox {
@eloyesp
eloyesp / mrfs.scss
Last active October 7, 2021 18:03
Micro Responsive Font Size
/* Simplified Responsive Font Size
* Usage is @include rfs(1.2rem);
* Used to embed when import is not available.
* Based on https://github.com/twbs/rfs
*/
@mixin rfs($value, $property: font-size) {
// Check value is in **rem**.
@if unit($value) != rem {
@error "`#{$value}` has not a valid unit. Use `rem`."
@eloyesp
eloyesp / shopify_party.rb
Created September 6, 2021 14:56
Fetch and process shopify articles
#!/usr/bin/env ruby
require 'httparty'
class Blog
include HTTParty
base_uri "https://#{ ENV['SHOPIFY_STORE'] }.myshopify.com"
headers 'Content-Type' => 'application/json',
'X-Shopify-Access-Token' => ENV['SHOPIFY_TOKEN']
@eloyesp
eloyesp / Procfile
Created May 12, 2021 13:46
Browser Sync setup with shopify.
themekit: theme watch --notify /tmp/themeWatchNotify
browsersync: browser-sync start --config bs-config.js
@eloyesp
eloyesp / vps_setup.sh
Last active November 11, 2020 19:13
Small fixes for VPS
#!/bin/bash
# Basic setup to make life easier when using the shell on a VPS
# set -x
set -e
if [ ! -f ~/.vim/colors/solarized.vim ]
then
wget -P ~/.vim/colors https://raw.githubusercontent.com/altercation/solarized/master/vim-colors-solarized/colors/solarized.vim
fi