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
{ | |
"config": { | |
"disable-tls": true, | |
"secure-http": false | |
} | |
} | |
# to disable checking secure http on windows | |
composer config -g -- disable-tls true | |
composer config -g -- secure-http false |
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 myMerge(\Doctrine\ORM\EntityManager $em, $newObject) | |
{ | |
$newObjectId = $em->getClassMetadata(get_class($newObject))->getSingleIdReflectionProperty()->getValue($newObject); | |
$existingObject = $em->getRepository(get_class($newObject))->find($newObjectId); | |
$propertyAccessor = PropertyAccess::createPropertyAccessor(); | |
foreach (get_object_vars($existingObject) as $key => $value) { | |
if ($propertyAccessor->isWritable($existingObject, $key)) { | |
$propertyAccessor->setValue($existingObject, $key, $value); | |
} |
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
"$schema": "https://rawgit.com/mzernetsch/jrgen/master/jrgen-spec.schema.json", | |
"definitions": {}, | |
"jrgen": "1.1", | |
"info": { | |
"title": "ExampleAPI", | |
"description": [ | |
"An example api which handles various rpc requests.", | |
"This api follows the json-rpc 2.0 specification. More information available at http://www.jsonrpc.org/specification." | |
], | |
"version": "1.0" |
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
#sudo pip3 install mysqlclient fails with mysql_config not found | |
sudo apt-get install libmysqlclient-dev | |
#without pip3 it will not going to work for python3 | |
sudo pip3 install mysqlclient | |
# to run django migration | |
python3 manage.py migrate |
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
$trace = []; | |
$str1 = 'bcadb'; | |
$N = strlen($str1); | |
$str2 = 'acdb'; | |
$M = strlen($str2); | |
$MAX = $N + $M; | |
echo 'MAX=' . $MAX . PHP_EOL; |
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
#!/usr/sh | |
sudo service docker stop && sudo apt-get purge -y docker-engine && sudo apt-get autoremove --purge -y docker-engine && sudo rm -rf /var/lib/docker && sudo apt-get update && sudo apt-get install -y docker-engine && sudo service docker start && sudo docker run hello-world && sudo usermod -aG docker $USER |
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
" install plugin manager git clone https://github.com/Bashka/vim_lib.git | |
" ~/.vim/bundle/vim_lib | |
" | |
set nocompatible " be iMproved, required | |
filetype off " required | |
set rtp=~/.vim/bundle/vim_lib " start vim_lib | |
call vim_lib#sys#Autoload#init('/.vim', 'bundle') | |
Plugin 'vim_lib' | |
" " Другие плагины | |
" set the runtime path to include Vundle and initialize |
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
CREATE TABLE tbl_fields_unique LIKE tbl_fields; | |
ALTER TABLE tbl_fields_unique | |
ADD UNIQUE KEY unq (fieldno,fieldserial,id,fielddate,fieldsid); | |
INSERT IGNORE INTO tbl_fields_unique | |
SELECT * FROM tbl_fields; | |
ALTER TABLE tbl_fields RENAME tbl_fields_old; | |
ALTER TABLE tbl_fields_unique RENAME tbl_fields; |
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
<!--[if lt IE 9]> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
if (typeof jQuery == "undefined") { | |
document.write(unescape('%3Cscript src="/js/jquery-1.10.2.min.js" type="text/javascript"%3E%3C/script%3E')); | |
} | |
</script> | |
<![endif]--> | |
<!--[if gte IE 9]><!--> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> |