Skip to content

Instantly share code, notes, and snippets.

@umanshield
umanshield / Select.sql
Last active August 26, 2020 12:04
#mysql
SELECT City,Population FROM north_american_cities WHERE country='Canada';
SELECT city,Longitude FROM north_american_cities
WHERE Longitude < (SELECT LONGITUDE FROM north_american_cities WHERE City='Chicago')
ORDER BY LONGITUDE ASC;
SELECT city,population FROM north_american_cities
WHERE Country ='Mexico'
ORDER BY Population desc
limit 2;
@umanshield
umanshield / jsOOPatterns.js
Last active August 29, 2015 14:27 — forked from pongsak-s/jsOOPatterns.js
Javascript:jsOOPatterns.js
var test1 = { a: 1, b: 2}
var test2 = Object.create(test1);
// 1. decorating pattern
var getReuseObject = function(obj, location) {
obj.loc = location;
return obj;
};
obj1 = getReuseObject({}, 1);
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 '
@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' ... '

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 / 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
{
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
"rulers":
[
80,
120
],
"tab_size": 4,
"translate_tabs_to_spaces": true,
@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 -куда
#Просмотр содержимого архива
@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 / hotkeys.txt
Last active February 21, 2016 12:13
PHPStrom hacks
multicursor cmd(win key)+alt+click