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 | |
$dbh = ['user_10', 'user_02', 'user_05', 'user_08', 'user_07', 'user_06', 'user_09']; | |
$a = function ($un = '') use ($dbh, &$a){ | |
$random_digit = sprintf("%02d", rand(0, 10)); | |
$username_random = "user_" . $random_digit; | |
if(strlen($un)){ | |
$username = $un; | |
}else{ | |
$username = $username_random; | |
} |
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 | |
/** | |
* Image uploader | |
*/ | |
class ImageUploader | |
{ | |
private $this; | |
private $id; | |
private $uploadPath; | |
public $updateId; |
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
var a = setInterval(function() { | |
$('canvas').parent().addClass('canvas'); | |
}, 1000) |
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
export TERM=xterm-color | |
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32' | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxCxDxBxegedabagacad | |
alias grep="/usr/bin/grep $GREP_OPTIONS" | |
unset GREP_OPTIONS | |
export CYGWIN="nodosfilewarning mintty detect_bloda" | |
echo -ne '\eP\e]10;#CCCCCC\a' # Foreground -> base0 | |
echo -ne '\eP\e]11;#2D2D2D\a' # Background -> base03 | |
echo -ne '\eP\e]12;#00AAFF\a' # Cursor -> red |
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
//подставить в el DOM-селектор попячиваемого элемента | |
function pepyachka(el) { | |
if (typeof window.jQuery == "undefined") { | |
var g = document.createElement('script'); | |
g.type = "text/javascript"; | |
g.src = "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"; | |
document.head.appendChild(g); | |
} | |
var | |
a = document.createElement('link'), |
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
DirectoryIndex index.php | |
ErrorDocument 404 /404/ | |
RewriteEngine On | |
Options +FollowSymlinks | |
Options -Indexes -MultiViews | |
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
$('.geocode').click(function(e){ | |
e.preventDefault(); | |
var address = $('[name="address"]').val(); | |
console.log(address) | |
$.ajax( | |
{ | |
url:'http://geocode-maps.yandex.ru/1.x/?format=json&geocode='+address | |
} | |
).success(function(data){ | |
var resp = data.response.GeoObjectCollection.featureMember[0].GeoObject.Point.pos |
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
<div class="button insert">Добавить поле</div> | |
<form class="ui-filterable" method="POST"> | |
<? | |
$sum=4; | |
for ($count=0; $count <$sum ; $count++) | |
{ | |
?> | |
<input type="text" class="input text" name="preset[]" placeholder="text" value="preset text <?=$count?>"/> | |
<?}?> | |
<input class="button submit" type="submit"> |
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
var breakpoint_1 = 800; | |
function checkHeight(){ | |
var wh = $(window).height() || window.innerHeight || root.clientHeight || body.clientHeight ; | |
if (wh<=breakpoint_1){ | |
$('html').addClass('smallscreen'); | |
}else{ | |
$('html').removeClass('smallscreen'); | |
}; | |
$('.popup').css('margin-left', $('.popup').width() / -2); |