Skip to content

Instantly share code, notes, and snippets.

View Tobur's full-sized avatar

Alexandr Sharamko Tobur

  • Kharkov
View GitHub Profile
data: [
{
fixture_id: 123
markets: [
{
market_id: 1,
market_name: '1X2',
providers: [
{
provider_id: 4,
//It works only with + and - operation
//If need to use operations like * or / and so on: need to add prioriry of operations
//Also exist algoritm with "stack" and "recursion".
//Current algoritm is most simple way for equialent operations.
var str = "1-(2-3-(4-5))+6-(8-10)+(3+4)";
function _calculate(a, op, b) {
a = a * 1;
b = b * 1;
/**
* @TODO find out yii 1 way to split extion per request method
*
* @throws CException
*/
public function actionIndex()
{
$request = $this->getRequest();
if ($request->getIsPostRequest()) {
$this->update();

$(“a[target=_blank]”).each(function () { var href = $(this).attr(“href”); // retrive href foreach a window.open(href) });

<?php
function revertWord($word)
{
$length = strlen($word);
for ($i = 0, $j = $length - 1; $i < ($length / 2); $i++, $j--) {
$t = $word[$i];
$word[$i] = $word[$j];
$word[$j] = $t;
@Tobur
Tobur / draw_pyramids.php
Created January 27, 2018 11:33
Just pyramids
<?php
function draw($n)
{
for ($i = 1; $i < $n; $i++) {
$spaces = $n - $i;
for ($j = 0; $j < $spaces; $j++) {
echo ' ';
}
{
"results" : [
{
"address_components" : [
{
"long_name" : "ST 28",
"short_name" : "ST 28",
"types" : [ "street_number" ]
},
<pre>
Geocoder\Result\Geocoded Object([latitude:protected] => 33.2729683 [longitude:protected] => -111.6850526 [bounds:protected] => Array([south] => 33.271331 [west] => -111.6850526 [north] => 33.2729683 [east] => -111.683556 ) [streetNumber:protected] => [streetName:protected] => East Ryan Road [cityDistrict:protected] => [city:protected] => Queen Creek [zipcode:protected] => 85242 [county:protected] => Maricopa County [countyCode:protected] => MARICOPA COUNTY [region:protected] => Arizona [regionCode:protected] => AZ [country:protected] => United States [countryCode:protected] => US [timezone:protected] => )
</pre>
public function paymentAction(Request $request)
{
$paymentType = $this->createPaymentForm($request);
$paymentType->handleRequest($request);
if (!$paymentType->isValid()) {
return $this->renderErrors($paymentType);
}
//NEED REMOVE IT AS SOON AS POSSIBLE
$contractId = $request->get('contract_id');
$contract = $this->getDoctrine()
@Tobur
Tobur / nginx.conf
Created July 14, 2014 10:03 — forked from leon/nginx.conf
server {
listen 80;
server_name localhost;
root /home/website/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {