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 | |
if (!defined('BASEPATH')) | |
exit('No direct script access allowed'); | |
function mb_ucfirst($str, $encoding = "UTF-8", $lower_str_end = false) { | |
$first_letter = mb_strtoupper(mb_substr($str, 0, 1, $encoding), $encoding); | |
$str_end = ""; | |
if ($lower_str_end) { | |
$str_end = mb_strtolower(mb_substr($str, 1, mb_strlen($str, $encoding), $encoding), $encoding); |
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
Какво е CURL ? | |
cURL е инструмент за прехвърляне на информация от и към сървър чрез използването на някой от поддържаните протоколи (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP). Програмата е направена да работи без намеса на потребителия. | |
cURL също поддържа proxy, user authentication, FTP ъплоад, HTTP post, SLL връзки, кукита, файлов трансфер, металинк и много други функции. | |
Статус на операциите | |
cURL обикновенно показва статуса на текущата операция, количество на прехвърлената информация, бързина на прехвърляне, очаквано време за приключване и други. |
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
Understanding the differences between Illustrator and Photoshop | |
can range from confusing to downright frustrating for those who are | |
new to graphics and image editing. Which application should you use | |
for your project? Should you use a combination of the two together, or | |
just stick with one? Having a household name as Photoshop does, many people | |
simply turn to Photoshop for all their work, but that may not be the best | |
choice for all your graphics work. | |
It really boils down to having an understanding not only of what you wish to achieve, | |
but also having a firm grasp on the key differences between Photoshop and Illustrator; |
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
When building a custom web application you need to consider the type of database that best suits the data. | |
Here's a quick guide on the differences between MySQL (Relational) and MongoDB (Non-Relational / NoSQL). | |
###Data Representation | |
-MySQL represents data in tables and rows. | |
-MongoDB represents data as collections of JSON documents. | |
If you think about it, a JSON document is very much like what you would be | |
working with in your application layer. If you are using javascript, | |
it's exactly what you're working with. If you're using PHP, it's just like an associative array. | |
If you're using python, its just like a dictionary object. |
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
/*! | |
* jQuery UI Touch Punch 0.2.3 | |
* | |
* Copyright 2011–2014, Dave Furfero | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
* | |
* Depends: | |
* jquery.ui.widget.js | |
* jquery.ui.mouse.js | |
*/ |
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
public function getPagesForSpace() { | |
$arr = array(); | |
$result = $this->query("SELECT * FROM pages ORDER BY id ASC"); | |
if($result !== false) { | |
while ($row = $result->fetch_assoc()) { | |
$arr[] = $row; | |
} | |
function buildTree(array $elements, $parentId = 0) { | |
$branch = array(); |
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 | |
function convertCurrency($amount, $from, $to){ | |
$url = "https://www.google.com/finance/converter?a=$amount&from=$from&to=$to"; | |
$data = file_get_contents($url); | |
preg_match("/<span class=bld>(.*)<\/span>/",$data, $converted); | |
$converted = preg_replace("/[^0-9.]/", "", $converted[1]); | |
return round($converted, 3); | |
} | |
# Call function |
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
The solution: | |
The two tables must have the same engine i.e. ENGINE=InnoDB. (can be others: ENGINE=MyISAM works too) | |
The two tables must have the same charset. | |
The PK column(s) in the parent table and the FK column(s) must be the same data type. (if the PRIMARY Key in the Parent table is UNSIGNED, be sure to select UNSIGNED in the Child Table field) | |
The PK column(s) in the parent table and the FK column(s), if they have a define collation type, must have the same collation type; | |
If there is data already in the foreign key table, the FK column value(s) must match values in the parent table PK columns. | |
And the child table cannot be a temporary table. |
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
Dig (domain information groper) е програма за Linux също както е nslookup за Windows. Тя е малко по мощна. Тук са описани някои възможности за използването и, заявки към различни nameserver-и, заявки към специфични записи на nameserver (A, AAAA, MX, CNAME, TXT) и други. | |
Инсталиране на dig | |
Ако работите с Red Hat базирана дистрибуция (centos, fedora, red hat), може да използвате yum: | |
yum install bind-utils | |
За всяка Debian базирана е apt-get: |
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
<h2>CORS (Cross-Origin Resource Sharing)</h2> | |
<p>When you do a cross-origin request, the browser sends <code>Origin</code> header with the current domain value.</p> | |
<pre> | |
Origin: http://zinoui.com</pre> | |
<p>When the server receives the request, check whether the origin header is within the allowed list, and sends a response with <code>Access-Control-Allow-Origin</code></p> | |
<pre> |