This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
DBS=$1 | |
USER=$2 | |
PASS=$3 | |
if [[ -z $DBS || -z $USER || -z $PASS ]]; | |
then | |
echo 'Usage: ./mysql-innodb-utf.sh DB USER PASS'; | |
exit 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$host = 'localhost'; | |
$user = 'root'; | |
$pass = ''; | |
$database = 'database'; | |
$db = mysql_connect($host, $user, $pass); | |
mysql_query("use $database", $db); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generate keyframe for CSS3 animation | |
* ios bounce icon effect | |
* @size = bounce size (sample: 10) | |
* @onFrames = % time on frames (for delay or other effect 0-100) (sample: 50) | |
*/ | |
function buildFrames(size, onFrames) | |
{ | |
var source = ["0", "60", "83", "100", "114", "124", "128", "128", "124", "114", "100", "83", "60", "32", "0", "0", "18", "28", "32", "28", "18", "0"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://www.1c-bitrix.ua/download/scripts/bitrixsetup.php && \ | |
sed -i 's/gztell/gztell64/' bitrixsetup.php && \ | |
sed -i 's/gzseek/gzseek64/' bitrixsetup.php && \ | |
sed -i 's/gzopen/gzopen64/' bitrixsetup.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* project minimalistic build template | |
* | |
* source - directory with source files | |
* source/img - standalone backgrounds or images for web | |
* source/icons - project icons (generate sprite) | |
* source/less - less project files | |
* source/css - css project files | |
* source/js - js project files | |
* source/lib - external libs, not from bower |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PCode | |
{ | |
private static $vector = array ( | |
0 => | |
array ( | |
'detect' => '247\\d\\d\\d\\d', | |
'mask' => '+247-####', | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @DATABASE_NAME = 'name_of_your_db'; | |
SELECT CONCAT('ALTER TABLE `', table_name, '` ENGINE=MyISAM;') AS sql_statements | |
FROM information_schema.tables AS tb | |
WHERE table_schema = @DATABASE_NAME | |
AND `ENGINE` = 'InnoDB' | |
AND `TABLE_TYPE` = 'BASE TABLE' | |
ORDER BY table_name DESC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PROJNAME= #Имя проекта | |
CHARSET= #Кодировка базы данных (utf8) | |
DBNAME= #Имя базы данных для резервного копирования | |
DBFILENAME= #Имя дампа базы данных | |
ARFILENAME= #Имя архива с файлами | |
HOST= #Хост MySQL | |
USER= #Имя пользователя базы данных | |
PASSWD= #Пароль от базы данных | |
DATADIR= #Путь к каталогу где будут храниться резервные копии |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Iterator<String> iter = json.keys(); | |
while (iter.hasNext()) { | |
String key = iter.next(); | |
try { | |
Object value = json.get(key); | |
} catch (JSONException e) { | |
// Something went wrong! | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* How to prevent "white page" on CHttpException and other errors | |
* | |
* Instruction: | |
* 1. place Hhvm.php to protected.components | |
* 2. add to index.php lines: | |
* | |
* define('YII_DEBUG', false); |
OlderNewer