Skip to content

Instantly share code, notes, and snippets.

View mrtrom's full-sized avatar

Alexander Ochoa mrtrom

  • Here
View GitHub Profile
@mrtrom
mrtrom / aliexpress-orders-csv.js
Created January 15, 2022 00:51
AliExpress Orders to Clipboard CSV
// ==UserScript==
// @name AliExpress Orders Exporter
// @namespace https://gist.github.com/
// @version 0.4
// @description Retrieve Aliexpress order information and export as CSV via clipboard
// @author You
// @match https://trade.aliexpress.com/orderList.htm*
// @grant unsafeWindow
// @grant GM_xmlhttpRequest
// @grant GM_setClipboard
@mrtrom
mrtrom / wordpress-https.md
Created May 4, 2017 21:32
Migration a Wordpress site from HTTP to HTTPS
  1. Create a backup copy of your site and your database!

  2. I reccomend starting with a plugin that manages all of this stuff for you, but if it doesn't work keep reading! :D

  3. Add these lines to to wp-config.php file

    define('FORCE_SSL_ADMIN', true);
    
    if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on';
@mrtrom
mrtrom / remove-html-tags.js
Created March 16, 2017 21:16
Removes HTML tags from a string that are not listed in the whitelist
/*
<b> - bold, use as last resort <h1>-<h3>, <em>, and <strong> are
preferred.
<blockquote> - specifies a section that is quoted from another source.
<code> - defines a piece of computer code.
<del> - delete, used to indicate modifications.
<dd> - describes the item in a <dl> description list.
<dl> - description list.
<dt> - title of an item in a <dl> description list.
<em> - emphasized.
@mrtrom
mrtrom / psql-commands.sql
Created February 28, 2017 22:42
PostgreSQL useful commands
--Check activity tracker
SELECT *
FROM pg_stat_activity
--Check activity tracker by query time
SELECT
(CURRENT_TIMESTAMP - query_start) as query_time
, *
-- ^^ SQL protip: separating SELECT parameters by linebreaks and putting the
-- comma first lets you quickly comment out single parameters
@mrtrom
mrtrom / README.md
Last active August 22, 2016 21:50 — forked from ngryman/README.md
IntelliJ javascript live templates (snippets)

IntelliJ javascript live templates

Just a dump of handy live templates I use with IntelliJ. They should also work with WebStorm.

How to

  • Go to settings.
  • Search for live templates.
  • Under the javascript section you should be able to manage your templates.
@mrtrom
mrtrom / git-commands.md
Created July 8, 2016 03:53
Useful git commands

Here there are some examples of git commands that I use often.

Not all commands written here are git commands, but all of them are related to git. Please refer to the documentation for more details.

#####Set your details

git config --global user.name "John Doe"
git config --global user.email "john@example.com"

Use --global to set the configuration for all projects. If git config is used without --global and run inside a project directory, the settings are set for the specific project.

@mrtrom
mrtrom / docker.sh
Last active January 30, 2017 19:48
Docker useful commands
# To install a new container image:
$ https://hub.docker.com/
# To show all the images:
$ docker images
# To tag a new image:
$ docker tag [imageID] [pathToRepoImage]:[version]
# $ docker tag f28ca8672301 mrtrom/docker-whale:latest
@mrtrom
mrtrom / output.sh
Created May 26, 2016 23:54
Print log in a file
$ [command] &> /some/place/copy-db.log
# More information at http://www.tldp.org/LDP/abs/html/io-redirection.html