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
nnoremap <C-k> mz:m-2<CR>`z== | |
inoremap <C-j> <Esc>:m+<CR>==gi | |
inoremap <C-k> <Esc>:m-2<CR>==gi | |
vnoremap <C-j> :m'>+<CR>gv=`<my`>mzgv`yo`z | |
nnoremap <C-j> mz:m+<CR>`z== | |
vnoremap <C-k> :m'<-2<CR>gv=`>my`<mzgv`yo`z |
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
history | awk '{print $2}' | sort | uniq -c | sort -rn | head |
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
'#'+Math.floor(Math.random()*16777215).toString(16); |
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
style "no-resize-handle" | |
{ | |
GtkWindow::resize-grip-height = 0 | |
GtkWindow::resize-grip-width = 0 | |
} | |
class "GtkWidget" style "no-resize-handle" | |
style "vimfix" { |
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 | |
/** | |
* Create squared image | |
* | |
* @param $originalFile file path | |
* @param null $destinationFile if null - file will be displayed (output) | |
* @param int $squareSize px | |
* @return bool | |
*/ |
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 | |
/** | |
* Reduce image by factor | |
* | |
* @param string $originalFile file path | |
* @param string $destinationFile file path | |
* @param int $factor | |
* @return bool | |
*/ |
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 | |
/** | |
* Compile video from images with FFMPG | |
* | |
* @param string $tmpDirWithImages | |
* @param string $ext jpg|png... | |
* @param string $videoFilePath | |
*/ |
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
diff <(identify -verbose 1.jpg) <(identify -verbose 2.jpg) |
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 | |
function isAjax() | |
{ | |
return | |
isset($_SERVER['HTTP_X_REQUESTED_WITH']) && | |
$_SERVER['HTTP_X_REQUESTED_WITH'] && | |
strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'; | |
} |
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
// array_multi_intersect([[1, 2, 3], [2, 3, 4], [0, 2, 3, 8]]); => [2, 3] | |
function array_multi_intersect(arr) | |
{ | |
var firstArr = [], | |
totalArr = [], | |
i, | |
j, | |
k; | |
if (arr.length < 2) { |
OlderNewer