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'}
- 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

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 / .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)
@jkanclerz
jkanclerz / install-ffmpeg-amazon-linux.sh
Last active May 10, 2017 15:35 — forked from prashantmaurice/install-ffmpeg-amazon-linux.sh
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on gist.github.com/gboudreau/install-ffmpeg-amazon-linux.sh
# and https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@jkanclerz
jkanclerz / fix_file_dir_permissions.sh
Created December 20, 2016 13:14
Fix files dir permissions
#set 775 for all directories
find . -type d -exec chmod 775 {} \;
#set 664 for all files
find . -type f -exec chmod 664 {} \;
@jkanclerz
jkanclerz / fix_permission.sh
Last active November 9, 2016 09:24
Magento fix http user permission
#!/bin/bash
HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
dirs=('var' 'pub/media' 'pub/static')
function fix_permission {
sudo chmod -R +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" $1
sudo chmod -R +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" $1
}
@jkanclerz
jkanclerz / commands.sh
Last active October 26, 2016 14:52
usefull bash
#!/bin/bash
#Removes files older than 14 days from directory
#allows to set autoclean up some temp directory
find ~/Downloads/* -mtime +14 -exec rm -rf {} \;
#synchronize dirs with remote server
rsync -avz --progress user@server:/some/path ./some_local_dir