Skip to content

Instantly share code, notes, and snippets.

View fedir's full-sized avatar
🌤️
The sun is behind every cloud

Fedir RYKHTIK fedir

🌤️
The sun is behind every cloud
View GitHub Profile
@fedir
fedir / imOptions.txt
Created April 1, 2014 17:17
ImageMagick format options
\n newline
\r carriage return
< less-than character.
> greater-than character.
& ampersand character.
%% a percent sign
%b file size of image read in
%c comment meta-data property
%d directory component of path
%e filename extension or suffix
@fedir
fedir / wgetSite.sh
Last active August 29, 2015 13:58
Make static backup of the site
#!/bin/bash
DOMAIN=$1
wget --recursive --no-clobber --page-requisites --html-extension --convert-links --domains $DOMAIN --no-parent --background $DOMAIN
@fedir
fedir / installPackagesForTypo3.sh
Last active August 29, 2015 13:59
install packages TYPO3
apt-get install apache2 php5 libapache2-mod-php5
apt-get install mysql-server mysql-client php5-mysql
apt-get install php5-xcache
apt-get install php5-imagick
apt-get install phpmyadmin
server {
listen 80;
server_name localhost;
root /var/www;
client_max_body_size 32M;
location = /clear.gif {
empty_gif;
expires max;
@fedir
fedir / getCurrentMonth.php
Last active August 29, 2015 14:00
php times
<?php
$now = time();
$curMonth = date('n');
$curYear = date('Y');
if ($curMonth == 12) {
$currentMonthEnds = mktime(0, 0, 0, 1, 1, $curYear+1);
} else {
@fedir
fedir / backupPackages.sh
Last active August 29, 2015 14:00
Linux mint installed packages listing and restoring // ref.: http://askubuntu.com/questions/17823/how-to-list-all-installed-packages
sudo dpkg --clear-selections
sudo dpkg --set-selections < ~/listPackages.txt
sudo apt-get autoremove
@fedir
fedir / checkJQueryVersion.js
Created May 6, 2014 10:34
Check jQuery version
jQuery().jquery;
@fedir
fedir / dragAndDropHtml5.js
Created May 7, 2014 13:42
Drag & Drop HTML5 - full example http://jsfiddle.net/WhL38/8/
function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("Text",ev.target.id);
}
function drop(ev) {
ev.preventDefault();
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit"
@fedir
fedir / removeObjectFromArrayByProperty-1.js
Last active August 29, 2015 14:01
Remove an object from an array based on it's property
// ref .: http://stackoverflow.com/questions/15287865/remove-array-element-based-on-object-property
myArray = myArray.filter(function( obj ) {
return obj.field !== 'money';
});