This file contains hidden or 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
function inViewport() { | |
$('.active-area').each(function(){ | |
let divPos = $(this).offset().top, | |
topOfWindow = $(window).scrollTop(); | |
if( divPos < topOfWindow+$(window).height() ){ | |
$(this).addClass('visible'); | |
} | |
}); | |
} |
This file contains hidden or 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
function isIOS() { | |
var userAgent = navigator.userAgent || navigator.vendor || window.opera; | |
// iOS detection from: http://stackoverflow.com/a/9039885/177710 | |
return (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream); | |
} |
This file contains hidden or 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
function installcomposer() { | |
sudo wget https://getcomposer.org/download/1.6.5/composer.phar -O /usr/local/bin/composer | |
sudo chmod +x /usr/local/bin/composer | |
} |
This file contains hidden or 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
function addsite(){ | |
#not recommended to use on production server!!! | |
#req: | |
# - apache, | |
# - php (at least 7 for new magento), | |
# - wp-cli (wordpress comand line), | |
# - composer | |
# - laravel |
This file contains hidden or 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
var gulp = require('gulp'); | |
var ts = require('gulp-typescript'); | |
var browserify = require("browserify"); | |
var source = require('vinyl-source-stream'); | |
var watchify = require("watchify"); | |
var tsify = require("tsify"); | |
var gutil = require("gulp-util"); | |
gulp.task('typescript', function () { | |
return gulp.src('./app/src/**/*.ts') |
This file contains hidden or 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
#!/bin/bash | |
# | |
# sudo apt-get install jpegoptim | |
# sudo apt-get install optipng | |
# | |
IMGFOLDER=/path/to/image/folder | |
JPGLOG=/path/to/image/folder/jpegoptim.log | |
PNGLOG=/path/to/image/folder/pngoptim.log | |
JPGCOMPRESSION=75 | |
echo `date` >> $PNGLOG |
This file contains hidden or 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
function fetlc() { | |
find . -name '*.*' -exec sh -c ' | |
a=$(echo "$0" | sed -r "s/([^.]*)\$/\L\1/"); | |
[ "$a" != "$0" ] && mv "$0" "$a" ' {} \; | |
} |
This file contains hidden or 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 | |
if(!class_exists('ExtClass')) { | |
class ExtClass { | |
protected $data = array(); | |
public function __set($name, $value) { |
This file contains hidden or 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 sumniki_v_sicnike($orig) { | |
return str_replace( | |
array("š", "đ", "č", "ć", "ž", "Š", "Đ", "Č", "Ć", "Ž"), | |
array("s", "d", "c", "c", "z", "S", "D", "C", "C", "Z"), | |
$orig); | |
} |
This file contains hidden or 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
#install apache2 | |
sudo apt-get install apache2 -y | |
sudo service apache2 start | |
#/var/www/html/ | |
#A. open | |
#sudo nano /etc/apache2/apache2.conf | |
#A.1 | |
#Timeout 30 | |
#KeepAlive On | |
#MaxKeepAliveRequests 0 |