Skip to content

Instantly share code, notes, and snippets.

@manelio
manelio / provision.sh
Last active May 24, 2024 15:02
Provision Ubuntu 23
export USER_EMAIL="manel@ecomm.pro"
export USER_NAME="Manel R. Doménech"
sudo apt install -y \
openssh-server \
curl \
vim \
git \
zsh \
jq \
# -*- coding: utf-8 -*-
import pyodbc
import requests
import logging
import time, datetime, re
import csv
# Backoff time sets how many minutes to wait between google pings when your API limit is hit
BACKOFF_TIME = 10
# Return Full Google Results? If True, full JSON results from Gooñgle are included in output
@manelio
manelio / test
Created February 21, 2023 12:02
​L510BF1E33
@manelio
manelio / eip55tobech32.js
Created January 23, 2022 18:31
Convert address from EIP-55 to Bech32
// CommonJS CLI version
const { bech32 } = require('bech32');
const { toChecksumAddress } = require('web3-utils');
const {
decode: bech32Decode,
encode: bech32Encode,
fromWords: bech32FromWords,
toWords: bech32ToWords
@manelio
manelio / ubuntu-docker-provision.sh
Created May 30, 2021 09:13
ubuntu-docker-provision.sh
#!/bin/bash
# sudo apt-get remove -y docker docker-engine docker.io
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl rsync gnupg2 software-properties-common jq
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
@manelio
manelio / tutorial.md
Created August 30, 2018 16:20 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

@manelio
manelio / wp-bedrock-install.sh
Last active November 10, 2016 19:31
Install wordpress with the Bedrock stack totally from command line, even the generation of keys and salts
#!/bin/sh
#
# YOU CAN USE THIS SCRIPT AS A COMMAND OR JUST COPY AND PASTE THE WHOLE SCRIPT IN TERMINAL
#
<<'COMMENT'
Requirements:
A directory with at least 2 files: .env and setuprc
@manelio
manelio / README.md
Created October 14, 2015 02:16 — forked from dciccale/README.md
Tiny Cross-browser DOM ready function in 111 bytes of JavaScript

DOM Ready

Tiny Cross-browser DOM ready function in 111 bytes of JavaScript.

@manelio
manelio / gist:5791101c513bf2d5d531
Created November 12, 2014 11:40
Magento performance: getSortedAttributes caching
Core optimization I:
Test:
url: http://myproject.com.local/ (a catalog page that loads 111 products)
Before:
Total Incl. Wall Time (microsec): 34,340,233 microsecs
Number of Function Calls: 10,098,542
@manelio
manelio / treendent.rb
Created September 25, 2014 19:29
Ruby minimal parser for indent based files representing a filesystem tree. It can be used to easily create files and directories.
#!/usr/bin/ruby -i
=begin
* treendent.rb
* Manel R. Doménech (@manelio)
it's annoying for me to create files and directories in most of the editor I
use, like Sublime Text and Vim. Also in the shell.
Because that, I wrote a minimal parser called treendent for intend-based files
to design a filesystem tree. There are versions of the parser in php (treendent.php)