Skip to content

Instantly share code, notes, and snippets.

Allan Laal allanlaal

Block or report user

Report or block allanlaal

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dynamicStyles
var dynamicStyles = false;
var dynamicStylesCache = [];
var dynamicStylesLastId = 0;
/**
*
* @param ruleName string
* @param ruleContents array of key value pairs of CSS rules
@allanlaal
allanlaal / FF.toolbar.hide.keyconfig.js
Created Sep 14, 2014
Firefox: toggle visibility of toolbars (using KeyConfig)
View FF.toolbar.hide.keyconfig.js
// install the KeyConfig extension from http://mozilla.dorando.at/keyconfig.xpi and add this code as a new key
// First get all toolbars (that are not the tab bar)
var tbs = Array.filter(document.querySelectorAll('toolbar'), function (x) {
// remove // from the below line to keep showing the tabs toolbar:
//return x.id != 'TabsToolbar';
return true;
});
// For each toolbar
View zpanel_mysql_restarter.php
<?php
/**
* @desc MySQL restarter
* @example # /root/scripts/mysql_restarter.php >> /root/scripts/mysql_restarter.log
* @author Allan Laal <allan@permanent.ee>
* @since 2013-10-05
* @version DIRTY
*/
View zpanel_subdomain_bugfix_daemon.sh
#!/bin/sh
WORKDIR=/root/subdomain_bugfix_daemon/
# I recommend using a dedicated MySQL user with only SELECT rights if you are paranoid:
user="root"
pass="YOUR MYSQL PASSWORD HERE"
db="zpanel_core"
(mysql -u "$user" -p"$pass" "$db" <<EOF
SELECT COUNT(*) AS total FROM x_vhosts
EOF
@allanlaal
allanlaal / currency.sql
Last active Sep 3, 2019
SQL table of World currencies (even some expired ones) Source: http://bcmoney-mobiletv.com/blog/2008/12/30/currency-codes-dropdown-and-sql-table/ Cleaned up a bit, uses InnoDB and iso currency code as the PRIMARY key
View currency.sql
--
-- Table structure for table `currency`
--
CREATE TABLE IF NOT EXISTS `currency` (
`iso` char(3) CHARACTER SET utf8 NOT NULL DEFAULT '',
`name` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`iso`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
@allanlaal
allanlaal / countries.sql
Last active Dec 5, 2018 — forked from adhipg/countries.sql
uses InnoDB and UTF8, uses ISO2 code as the primary key
View countries.sql
--
-- Table structure for table `country`
--
CREATE TABLE IF NOT EXISTS `country` (
`iso` char(2) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
`nicename` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
`iso3` char(3) COLLATE utf8_unicode_ci DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
You can’t perform that action at this time.