Skip to content

Instantly share code, notes, and snippets.

@splittingred
splittingred / gist:1018793
Created June 10, 2011 13:05
Hide left trees in MODX Revolution
Ext.onReady(function() {
Ext.getCmp('modx-layout').hideLeftbar();
});
@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]))
@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 <[email protected]>
* @date : 2013-08-08
*
* References :
@slouma2000
slouma2000 / install_ruby_1.9.3
Last active September 14, 2024 01:23
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 )
@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?= <[email protected]>
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 ++--
@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
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active November 16, 2024 21:03 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export to tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@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();
}
});