Skip to content

Instantly share code, notes, and snippets.

View ivanvmoreno's full-sized avatar
❄️

Iván Moreno ivanvmoreno

❄️
View GitHub Profile
@ivanvmoreno
ivanvmoreno / functions.php
Last active May 11, 2017 11:56 — forked from ChromeOrange/functions.php
Custom Add To Cart Messages
<?php
/**
* Custom Add To Cart Messages
* Add this to your theme functions.php file
**/
// woocommerce_add_to_cart_message is now wc_add_to_cart_message
add_filter( 'wc_add_to_cart_message', 'custom_add_to_cart_message' );
function custom_add_to_cart_message() {
global $woocommerce;
@ivanvmoreno
ivanvmoreno / Test.js
Created December 9, 2019 12:43
mongoose auto-increment field on creation with middleware
const mongoose = require('mongoose')
const testSchema = new mongoose.Schema({
id: {
type: Number,
unique: true,
required: true,
min: 1,
},
})
@ivanvmoreno
ivanvmoreno / wordpress_backup.sh
Last active January 5, 2020 11:44
Automated wordpress backup and upload (rsync-like) to external object storage provider using s3cmd
#!/bin/bash
BKPDIR=
SITE_DOMAIN=
SITE_DIR="$BKPDIR"/"$SITE_DOMAIN"
WEBROOT=/var/www/"$SITE_DOMAIN"
BUCKET_NAME=
DBUSER=$(grep DB_USER $SITE_DIR/wp-config.php | awk -F\' '{print$4}')
DBNAME=$(grep DB_NAME $SITE_DIR/wp-config.php | awk -F\' '{print$4}')
'use strict'
const https = require('https')
const { Client } = require('@elastic/elasticsearch')
const { ES_ENDPOINT, PATTERN = /^es_log/i, PORT = 8080 } = process.env
const client = new Client({ node: ES_ENDPOINT })
const processLog = input => {
@ivanvmoreno
ivanvmoreno / keybase.md
Last active October 20, 2020 14:51
keybase.md

Keybase proof

I hereby claim:

  • I am ivanvmoreno on github.
  • I am ivanvm (https://keybase.io/ivanvm) on keybase.
  • I have a public key ASD5zgjroLT4zy4wkIvzt3ikIMdndblih16lCSRhFTFMLgo

To claim this, I am signing this object:

@ivanvmoreno
ivanvmoreno / KeepFreedomRunning
Created March 24, 2023 11:34
Launch agent to keep freedom.to macOS application running, even if I quit the application ✅
#!/usr/bin/osascript
# file: KeepFreedomRunning
if application "Freedom" is not running then
tell application "Freedom" to run
end if
@ivanvmoreno
ivanvmoreno / rocm-gpu-watch.sh
Created December 8, 2023 16:16
ROCm GPU monitor CLI
watch -n 0.1 /opt/rocm/bin/rocm-smi
@ivanvmoreno
ivanvmoreno / nieve.txt
Last active February 23, 2024 13:50
nieve.ai
___ ___ ___ ___
/\__\ ___ /\ \ /\__\ /\ \
/::| | /\ \ /::\ \ /:/ / /::\ \
/:|:| | \:\ \ /:/\:\ \ /:/ / /:/\:\ \
/:/|:| |__ /::\__\ /::\~\:\ \ /:/__/ ___ /::\~\:\ \
/:/ |:| /\__\ __/:/\/__/ /:/\:\ \:\__\ |:| | /\__\ /:/\:\ \:\__\
\/__|:|/:/ / /\/:/ / \:\~\:\ \/__/ |:| |/:/ / \:\~\:\ \/__/
|:/:/ / \::/__/ \:\ \:\__\ |:|__/:/ / \:\ \:\__\
|::/ / \:\__\ \:\ \/__/ \::::/__/ \:\ \/__/
/:/ / \/__/ \:\__\ ~~~~ \:\__\