View random_values.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
function randomIntFromInterval(min, max) { | |
return Math.floor(Math.random() * (max - min + 1) + min); | |
} | |
function generateData() { | |
var data_list = []; | |
var random = Math.floor(Math.random() * 10); |
View deobfuscation.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
<?php | |
/** | |
* First, we're going to establish an alphabet. We're never going to write code like: | |
* | |
* $foo = 'abc' | |
* | |
* Because it would be too easy to read. Instead, were' going to write code like: | |
* | |
* $alphabet = 'abcdefghijklmnopqrstuvwxyz'; |
View api_call.html
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Api tester</title> | |
</head> | |
<div id="login"> | |
<form id="formLogin"> | |
Login:<br> |
View gist:462af8b22ea9372460be2dc9282b4839
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
( find . -type d -name ".git" && find . -name ".gitignore" && find . -name ".gitmodules" ) | xargs rm -rf |
View gist:114c93a1e5e480cec1cc47e40ffbecaa
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
zend_extension=/usr/lib/php5/20100525/xdebug.so | |
xdebug.remote_enable=1 | |
xdebug.remote_port=9000 | |
xdebug.remote_host=192.168.0.104 | |
xdebug.remote_mode=req | |
xdebug.remote_connect_back=1 | |
xdebug.remote_autostart=0 | |
xdebug.idekey=PHPSTORM | |
xdebug.serverName=Example |
View hg
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
hg log -r "parents(min(branch(FOO-1636-checkbox-bug))) |
View custom PhpStorm VM options
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
# custom PhpStorm VM options | |
-Xms1024m | |
-Xmx2048m | |
-XX:ReservedCodeCacheSize=1024m | |
-XX:+UseConcMarkSweepGC | |
-XX:SoftRefLRUPolicyMSPerMB=512 | |
-ea | |
-Dsun.io.useCanonCaches=true | |
-Djava.net.preferIPv4Stack=true |
View gist:0cafb9f40d3b967fce79
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
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L] | |
RewriteCond %{THE_REQUEST} ^.*/index\.(php|html?) | |
RewriteRule ^(.*)index.(php|html?)$ /$1 [R=301,NC,L] |
View gist:5567680
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 | |
// защита от прямого доступа | |
defined('_JEXEC') or die('Restricted access'); | |
class Tableclassified extends JTable | |
{ | |
/** | |
* Первичный ключ | |
* | |
* @var integer |
View gist:5567674
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 save($data) | |
{ | |
$table = $this->getTable(); | |
$ads['text'] = iconv("cp1251", "UTF-8", $date['shptext']); | |
$ads['phone'] = $data['shpphone']; | |
$ads['quantity'] = $data['shpquantity']; | |
$ads['author'] = iconv("cp1251", "UTF-8", $data['shpname']); | |
$ads['ad_type'] = $data['shpview']; | |
$ads['cat'] = $data['category']; |