Skip to content

Instantly share code, notes, and snippets.

View jkanclerz's full-sized avatar
🎯
Focusing

Jakub Kanclerz jkanclerz

🎯
Focusing
View GitHub Profile
@jkanclerz
jkanclerz / notify_about_deployement.sh
Last active January 15, 2024 16:33
Slack's notify about deployment
#!/bin/bash
ENVIRONMENT=${ENVIRONMENT:-'STAGING'}
LINK=${LINK:-'https://your-link.local'}
JIRA=${JIRA:-'https://jira.local'}
SLACK_URL=${SLACK_URL:='https://hooks.slack.com/services/your-slack-url'}
USERNAME='Alf'
USER_ICON=':alf:'
CHANNEL=${CHANNEL:-'#testit'}
@jkanclerz
jkanclerz / log_rotate.sh
Last active May 9, 2023 11:22
Simple bash log rotate script
#!/bin/bash
checkSizeOver() {
typeset -i LFSB LFSM LOG_SIZE=10
LF=$1
LOG_SIZE=$2
LFSB=$(stat -c "%s" $LF)
# This is bytes - turn into MB, base 2}
LFSM=${LFSB}/1048576
# This is bytes - turn into MB, base 2
if [ $LFSM -gt $LOG_SIZE ]
@jkanclerz
jkanclerz / form-spinner.js
Created April 5, 2014 23:47
Form submit spinner
;(function ( $ ) {
'use strict';
$(document).ready(function() {
$('form').bind('submit', function() {
$(this).find('button[type="submit"] i').attr('class', 'glyphicon glyphicon-refresh animate');
});
});
})( jQuery );
- instalacja oprogramowania
- instalacja z repo
- nowe repo do systemu
+ EPEL
+ EPEL repo
+ sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
+ inne php + mysql server
+ REMI repo
+ https://rpms.remirepo.net/enterprise/remi-release-7.rpm
@jkanclerz
jkanclerz / deploy.sh
Created March 10, 2015 16:35
Remote Command Execution by ssh
#!/bin/bash
echo "deploy Was started"
hostname -f;
uptime;
for package in $@
do
echo $package
if [ "$(rpm -qa | grep -E "^$package")" != "" ]

Animated SVG Avatar

Created a login form with an SVG avatar that responds to the input in the email field. Used the GSAP TweenMax library + GSAP's MorphSVG plugin for the animating.

Email validation is very simple and crude just for the purposes of getting this prototype working.

A Pen by Darin on CodePen.

License.

@jkanclerz
jkanclerz / table_size
Created April 30, 2018 13:22
calculate table size
SELECT CONCAT(table_schema, '.', table_name),
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 ), 2), 'M') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 ), 2), 'M') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 ), 2), 'M') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 10
@jkanclerz
jkanclerz / fib.py
Created March 31, 2018 20:06 — forked from nad2000/fib.py
Threading with Python
def fib(n):
if n <= 2:
return 1
else:
return fib(n-1) + fib(n-2)
@jkanclerz
jkanclerz / form-ajax-submiter.js
Created April 5, 2014 23:54
file upload with progress bar
function progressHandler(event){
$("#kb_of_total").text("Uploaded "+Math.round(event.loaded/1024) +" kb of "+Math.round(event.total/1024));
var percent = (event.loaded / event.total) * 100;
$("#progressBar").attr('value', Math.round(percent));
$("#status").text(Math.round(percent)+"% uploaded... please wait");
}
function completeHandler(event){
$("#progressBar").attr('value', 100);
$("#status").text('Uploaded Success');
successHandler(event);
@jkanclerz
jkanclerz / .sh
Created June 9, 2017 13:25
Clear docker images, containers
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)