Skip to content

Instantly share code, notes, and snippets.

vladkras

Block or report user

Report or block vladkras

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vladkras
vladkras / reload_apache.sh
Created Jun 12, 2019
Test config and reload Apache in one command
View reload_apache.sh
function reload () {
STATUS=$(sudo apache2ctl configtest 2>&1)
OK=$(echo $STATUS | grep "OK" | wc -l)
if [[ $OK -eq 1 ]]; then
echo "reloading Apache..."
sudo service apache2 reload
else
echo "$STATUS"
LINEOF=$(echo "$STATUS" | grep -Eo "line ([0-9]+) of [^:]+")
if [ ! -z "$LINEOF" ]; then
@vladkras
vladkras / skypeupdate.sh
Created May 30, 2019
Ubuntu Linux auto update Skype™
View skypeupdate.sh
#! /bin/bash
DEB_FILE=/tmp/skype.deb
# remove old file if any
rm $DEB_FILE
# get download link
if [ -z "$1" ]; then
DOWNLOAD_LINK=https://go.skype.com/skypeforlinux-64.deb
else
DOWNLOAD_LINK="$1"
@vladkras
vladkras / default.conf
Last active Jul 15, 2019
NGINX redirect to app store and google play based on user agent
View default.conf
location = /gotoapp {
if ($http_user_agent ~* "iphone|ipod|ipad|appletv") {
return 301 https://www.apple.com/lae/ios/app-store/;
}
if ($http_user_agent ~* "android") {
return 301 https://play.google.com/store;
}
if ($http_user_agent ~* "Windows") {
return 301 https://www.microsoft.com/store/apps?rtc=1;
View jquery.fancybox-1.3.4.js
/*
* FancyBox - jQuery Plugin
* Simple and fancy lightbox alternative
*
* Examples and documentation at: http://fancybox.net
*
* Copyright (c) 2008 - 2010 Janis Skarnelis
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
*
* Version: 1.3.4 (11/11/2010)
@vladkras
vladkras / jquery.arise-0.1.1.js
Last active Dec 17, 2015
aRise - simple lightbox, fancybox & other gallery popups alternative. All in one file: no css and image files for controls. Only jQuery needed.
View jquery.arise-0.1.1.js
(function($) {
"use strict";
$.fn.aRise = function() {
// vars first of all
var links = this, total = this.length;
// add styles to head
$('head').append('<style type="text/css">#arise-div{position:absolute;top:20%;left:50%;cursor:pointer;background-color:#fff;border:1px #aaa solid;padding:2px 4px;border-radius:4px;}</style>');
links.each(function(index) {
$(this).click(function(e) {
e.preventDefault();
@vladkras
vladkras / jquery.easlyder-0.1.js
Created May 2, 2013
eaSlyder - fast super lightweight jQuery based slider
View jquery.easlyder-0.1.js
(function( $ ) {
$.fn.eaSlyder = function( millisec ) {
var $this = this, total = $this.length, cur = 0, timeout = millisec || 4000;
this.each(function(index) {
if (index) $(this).hide();
});
setInterval(function() {
$this.eq(cur).fadeOut(function() {
cur = ( cur == total-1 ) ? 0 : cur+1;
$this.eq(cur).fadeIn();
You can’t perform that action at this time.