Skip to content

Instantly share code, notes, and snippets.

@matdave
matdave / showrandom.js
Created October 8, 2021 15:32
simple JS randomizer commands
const showrandom = document.querySelectorAll("[showrandom]");
showrandom.forEach(el=>{
const count = el.getAttribute('showrandom') ? el.getAttribute('showrandom') : 1;
const children = el.children;
while(children.length > count){
const random = Math.floor(Math.random() * children.length);
children[random].remove();
}
});
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active May 12, 2024 00:29 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@matdave
matdave / MODX-Upgrade.md
Last active August 31, 2015 20:38
MODX Upgrade on cPanel

The key to upgrading MODX is backup & testing. It is imperative test all features after a major system upgrade, because some packages can break. Before upgrading packages or systems, look for upgrade notes within the website's wiki page or client's job notes if no wiki exists. Also, before upgrading ensure there is enough room on the server for at least double the current file size.

Lock Down the Manager

Either using the Manager or SSH update / create an .htaccess file behind the manager folder with the following command:

order deny,allow
deny from all
allow from YOUR-IP-ADDRESS
@renttek
renttek / 0001-BUGIFX-Magento-Zend-Framework-1-PHP5.6.patch
Last active July 5, 2021 17:42
Bugfix for Zend Framework 1 in Magento (>= 1.7.*.*) + PHP 5.6
From 473846959772d8160b34b92ae3bcecddf24b972f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julian=20Nu=C3=9F?= <julian.nuss@outlook.com>
Date: Tue, 23 Sep 2014 21:07:29 +0200
Subject: [PATCH 1/1] [BUGIFX] Zend Framework 1 + PHP5.6
---
lib/Zend/Locale/Format.php | 22 +++++++++++-----------
lib/Zend/Service/Audioscrobbler.php | 6 +++---
lib/Zend/Service/Technorati.php | 6 +++---
lib/Zend/Validate/Hostname.php | 4 ++--
@slouma2000
slouma2000 / install_ruby_1.9.3
Last active May 14, 2019 20:27
Install Ruby 1.9.3 on CentOS, RedHat using RVM
Step 1: Upgrade Packages
# yum update
# yum groupinstall "Development Tools"
Step 2: Installing Recommended Packages
# yum install gcc-c++ patch readline readline-devel zlib zlib-devel
# yum install libyaml-devel libffi-devel openssl-devel make
# yum install bzip2 autoconf automake libtool bison iconv-devel
Step 3: Install RVM ( Ruby Version Manager )
@smalot
smalot / PdfParser.php
Last active February 13, 2022 09:59
Use this static class to extract Text from Pdf files. It supports compressed and uncompressed Pdf (version 1.1 to 1.7) : tested It supports octal encoded (eg : \050) content, but not hexadecimal (eg : <005E>). In some cases, it works better than "pdftotext" binary tool.
<?php
/**
* @file
* Class PdfParser
*
* @author : Sebastien MALOT <sebastien@malot.fr>
* @date : 2013-08-08
*
* References :
@quandyfactory
quandyfactory / fiveoclocksomewhere.py
Last active December 16, 2015 10:39
It's 5 O'Clock Somewhere: This script tells you the nearest time zone in which it's after 5 o'clock PM.
#!/usr/bin/env python
"""This script tells you the nearest time zone in which it's after 5 o'clock PM."""
import datetime
def get_beer_timezone():
now = datetime.datetime.today()
print("The curent time is %s." % (str(now)[11:-7]))
@splittingred
splittingred / gist:1018793
Created June 10, 2011 13:05
Hide left trees in MODX Revolution
Ext.onReady(function() {
Ext.getCmp('modx-layout').hideLeftbar();
});