Skip to content

Instantly share code, notes, and snippets.

@umanshield
umanshield / DoctrineTips.php
Last active February 26, 2019 12:48
Symfony doctrine
// Disable logger
$em->getConnection()->getConfiguration()->setSQLLogger(null);
@umanshield
umanshield / bower.sh
Created February 22, 2016 11:39
Bower command
bower uninstall
bower i zepto --save-dev (-D)
bower i zepto --save (-S)
bower update jquery
touch gulpfile.json bower.json package.json
npm i gulp -D
npm i main-bower-files -D
npm i wiredeb -D
mkdir /{css,js} -p
@umanshield
umanshield / hotkeys.txt
Last active February 21, 2016 12:13
PHPStrom hacks
multicursor cmd(win key)+alt+click
@umanshield
umanshield / .htaccess
Last active July 18, 2019 15:47
Apache configuration
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
# Explicitly disable rewriting for front controllers
RewriteRule ^/web/app_dev.php - [L]
RewriteRule ^/web/app.php - [L]
# Fix the bundles folder
RewriteRule ^bundles/(.*)$ /web/bundles/$1 [QSA,L]
@umanshield
umanshield / Archive.sh
Last active September 9, 2019 22:21
ubuntu cmdtar.gz gz tar zip
tar -cf txt.tar *.txt # -f упаковка
tar -cvzf files.tar.gz ~/files # -z gzip
tar -cvjf files.tar.bz2 ~/files # -j bzip2
tar --exclude='file1' --exclude='patter*' --exclude='file2'
#Распаковка архив
tar -xvf /path/to/archive.tar.bz2
tar -xvf archive.tar.bz2 -C /path/to/folder #-C path/to/folder -куда
#Просмотр содержимого архива
{
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
"rulers":
[
80,
120
],
"tab_size": 4,
"translate_tabs_to_spaces": true,
@umanshield
umanshield / icon.md
Created January 24, 2016 08:24
To create Desktop shortcuts in Ubuntu
sudo apt-get install --no-install-recommends gnome-panel
gnome-desktop-item-edit ~/Desktop/ --create-new

Setfacl for access

sudo setfacl -R -m u:www-data:rX todo-symfony
-R recursive
-m modify
u user(g- group)
rXw read execute write

var directory var/cache and var/log

sudo setfacl -R -m u:www-data:rwX var

@umanshield
umanshield / install-redis-ubuntu.sh
Created November 6, 2015 12:17 — forked from iJackUA/install-redis-ubuntu.sh
Install Redis from source (Ubuntu)
#!/bin/bash
if [ "$(whoami)" != "root" ]; then
echo "ERROR : Run script as Root (sudo !!) please"
exit 1
fi
read -e -p "Redis version to be installed (change if needed) : " -i "2.8.2" VERSION
echo 'Installing redis v.'$VERSION' ... '
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias go='git checkout '
alias gk='gitk --all&'
alias gx='gitx --all'
alias got='git '