Skip to content

Instantly share code, notes, and snippets.

Avatar
🌤️
The sun is behind every cloud

Fedir RYKHTIK fedir

🌤️
The sun is behind every cloud
View GitHub Profile
@fedir
fedir / WeekNumber&FridayDate
Created Aug 26, 2015
WeekNumber & Las Week Working Day (Friday) in Google Spreadsheet
View WeekNumber&FridayDate
=7*C2+DATE(2015;1;1)-(8-WEEKDAY(date(O4;1;1)))
@fedir
fedir / getRemoteFileSize.js
Last active Aug 29, 2015
Get file size behind download link
View getRemoteFileSize.js
var request;
request = $.ajax({
type: "HEAD",
url: $("#url").val(),
success: function () {
alert("Size is " + request.getResponseHeader("Content-Length"));
}
});
// Res.: http://stackoverflow.com/a/1440804/634275
@fedir
fedir / checkIe.js
Created Feb 5, 2014
Check IE9 IE10
View checkIe.js
if (document.addEventListener) {
alert("IE9 or greater");
}
if (window.requestAnimationFrame) {
alert("IE10 or greater");
}
@fedir
fedir / getTotalFileSize.js
Created Feb 6, 2014
Get total file size before upload with HTML5 File API and jQuery
View getTotalFileSize.js
var totalSize = 0;
$("input:file").each(function(){
if($(this)[0].files[0]) {
totalSize = totalSize + $(this)[0].files[0].size;
}
});
@fedir
fedir / 800widthResize.sh
Created Feb 10, 2014
Resize the images to be 800 pixels width. Height will be calculated automatically.
View 800widthResize.sh
mogrify -resize 800x -format jpg *
View fr.sh
#!/bin/bash
ES='http://localhost:9200'
ESIDX='test3'
ESTYPE='test'
curl -XDELETE $ES/$ESIDX
curl -XPUT $ES/$ESIDX/ -d '{
"settings" : {
View bash_args.md
$$  The PID number of the process executing the shell. 
$?  Exit status variable. 
$0  The name of the command you used to call a program. 
$1  The first argument on the command line. 
$2  The second argument on the command line. 
$n  The nth argument on the command line. 
$*  All the arguments on the command line. 

$# The number of command line arguments.

View yolo.sh
alias yolo='git commit -am "Deal with it" && git push -f origin master'
@fedir
fedir / listImageSizesWithStatistics.sh
Last active Aug 29, 2015
Get sizes of files in teh folder with statistics of occurencies
View listImageSizesWithStatistics.sh
identify -format "%wx%h\n" somefolder/* | sort | uniq -c
@fedir
fedir / listOrderDimensions.sh
Created Apr 1, 2014
List files with ordering by dimensions
View listOrderDimensions.sh
identify -format "%wx%h %f\n" somefolder/* | sort -n