Skip to content

Instantly share code, notes, and snippets.

@killradio
killradio / lang_helper.php
Last active February 4, 2017 13:02
CodeIgniter - get user's language
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Retrieves supported user's language or use default one
* Usage:
* get_language(
* 'en',
* array(
* 'ru' => array( 'ru', 'be', 'uk' ),
@killradio
killradio / domains.sh
Created September 25, 2016 10:52
Check domains paid-till date
#!/bin/bash
cat /dev/null > whois-results.txt
for domain in `cat domains.txt`
do
echo "checking : $domain"
echo -n "$domain -- " >> whois-results.txt
PAID_TILL=`whois $domain | grep 'paid-till'`
@killradio
killradio / fix.sh
Created September 6, 2016 05:41
LEDs DIR-300 B1, DIR-600
# Commands should be run from SSH
# Link: http://svn.dd-wrt.com/ticket/1480
nvram set connblue=1
nvram commit
reboot
@killradio
killradio / webdav.sh
Created April 19, 2016 04:57
Backup and upload files to the Yandex.Disk
#!/bin/bash
# This script used to backup files and db to the Yandex.Disk.
# Also it encrypts every file with gpg utility.
TIME=`date +%s`
SERVER_NAME="<server_name>"
MYSQL_HOST="<host>"
MYSQL_USER="<user>"
@killradio
killradio / dd-wrt_custom-script.sh
Last active April 19, 2016 04:53
D-Link DIR-300NRU: Automatic connection repair for DD-WRT firmware
#!/bin/sh
# Put this script into crontab to be done automatically:
# */10 * * * * root /tmp/custom.sh
RELEASE="kill -USR2 `cat /var/run/udhcpc.pid` 2> /dev/null"
RENEW="kill -USR1 `cat /var/run/udhcpc.pid` 2> /dev/null"
WAN_GATEWAY=`nvram get wan_gateway`
if [ "$WAN_GATEWAY" != "0.0.0.0" ]; then
COUNTER=0
until ping -c 1 $WAN_GATEWAY > /dev/null; do
if [ $COUNTER -eq 3 ]; then
@killradio
killradio / dd-wrt_startup.sh
Last active February 8, 2021 10:49
D-Link DIR-300NRU: Fix lights colors for DD-WRT firmware
#!/bin/sh
AMBER="gpio enable 12; gpio disable 14"
GREEN="gpio enable 14; gpio disable 12"
while sleep 1; do
WAN_IPADDR=`nvram get wan_ipaddr`
if [ "$WAN_IPADDR" != "0.0.0.0" ]; then
LED=$GREEN
else
LED=$AMBER
fi
phpBB 3.0.14 Quick Reply with possibility to quote.
This allows to quote selected part of the message or whole message.
by @killradio
diff --git a/styles/prosilver/template/quickreply_editor.html b/styles/prosilver/template/quickreply_editor.html
index ea07c2e..7be7489 100644
--- a/styles/prosilver/template/quickreply_editor.html
+++ b/styles/prosilver/template/quickreply_editor.html
@killradio
killradio / IsWithinDistInMapArea.patch
Last active July 5, 2016 12:34
Check distance for SPELL_EFFECT_APPLY_AREA_AURA_*
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index e389af1..07cea4f 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -1119,9 +1119,11 @@ float WorldObject::GetDistanceZ(const WorldObject* obj) const
return (dist > 0 ? dist : 0);
}
-bool WorldObject::_IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D) const
+bool WorldObject::_IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D, bool incOwnRadius, bool incTargetRadius) const