Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# Yandex.Disk backup script v1.0 by Sergey Lukonin (neblog.info)
#
# # # # # # # # # # НАСТРОЙКИ БЕКАПА MYSQL # # # # # # # # # #
# Сервер БД
MYSQL_SERVER=mysql.some-server.ru
# Юзер, под которым будем делать бекап доступных баз, руту mysql обычно доступны все БД, отдельному пользователю обычно доступна БД конкретного проекта
@detain
detain / xml2array.php
Created October 21, 2014 00:49
xml2array() works great, mirrored from http://www.bin-co.com/php/scripts/xml2array/
<?php
/**
* xml2array() will convert the given XML text to an array in the XML structure.
* Link: http://www.bin-co.com/php/scripts/xml2array/
* Arguments : $contents - The XML text
* $get_attributes - 1 or 0. If this is 1 the function will get the attributes as well as the tag values - this results in a different array structure in the return value.
* $priority - Can be 'tag' or 'attribute'. This will change the way the resulting array sturcture. For 'tag', the tags are given more importance.
* Return: The parsed XML in an array form. Use print_r() to see the resulting array structure.
* Examples: $array = xml2array(file_get_contents('feed.xml'));
* $array = xml2array(file_get_contents('feed.xml', 1, 'attribute'));
@dreikanter
dreikanter / zend-tutorial-1.html
Last active April 13, 2017 20:01
Хабрапост 2007 года про Zend Framework — http://habrahabr.ru/post/31168/, http://habrahabr.ru/post/31173/
<b>Update (2014):</b> Это статья 2007 года, которая, к моему удивлению, до сих пор пользуется спросом. По этой причине я обновил её в соответствии с новыми правилами оформления постов на Хабре, и добавил подсветку синтаксиса для примеров кода. Если кому-то захочется что-то добавить или исправить, исходник текста с хабра-разметкой выложен в открытый доступ: https://gist.github.com/dreikanter/2b4ee996d7a775e707d7
<h4>Аннотация от переводчика</h4>
PHP — один из самых широко распространенных языков разработки веб-приложений и при этом один из самых спорных. Я очень часто видел негативное отношение к этой технологии, да и недостатки, провоцирующие это отношение — не для кого не являются секретом. Тем не менее, PHP активно эволюционирует и во многих отношениях постепенно становитс лучше. Одним из серьезных шагов его развития, на мой взгляд, является появление MVC-фреймворков, призванных систематизировать процесс разработки веб-приложений и приучить к порядку разработчиков, которым зачастую здорово не хватает силы
@commadelimited
commadelimited / harlem-shake.js
Created February 15, 2013 02:38
Harlem Shake Bookmarklet deconstructed
javascript: (function () {
function c() {
var e = document.createElement("link");
e.setAttribute("type", "text/css");
e.setAttribute("rel", "stylesheet");
e.setAttribute("href", f);
e.setAttribute("class", l);
document.body.appendChild(e)
}
function h() {
@ramsey
ramsey / md5.php
Created November 3, 2011 01:09
MD5 hash lookup script that returns XML
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* MD5 hash lookup script that returns XML
*
* written by Ben Ramsey (ben at benramsey dot com)
* with code by Ilia Alshanetsky (ilia at ilia dot ws)
*
* Copyright (c) 2005, Ilia Alshanetsky
* Copyright (c) 2005, Ben Ramsey