Skip to content

Instantly share code, notes, and snippets.

View patsma's full-sized avatar
💭
Perfection is not attainable, but if we chase perfection we can catch excellence

Patryk Smakosz patsma

💭
Perfection is not attainable, but if we chase perfection we can catch excellence
View GitHub Profile
@patsma
patsma / main.js
Created July 19, 2021 13:13
ScrollTrigger example
// "use strict";
window.addEventListener('load', () => {
(function () {
gsap.registerPlugin(ScrollTrigger);
gsap.set('body', {autoAlpha: 1})
gsap.set('html', {overflow: 'visible'})
[text* fname placeholder "First name*"][text* lname placeholder "Last name*"][email* email placeholder "Email address*"][text* tel placeholder "Telephone*"][text* city placeholder "City*"][text* postcode placeholder "Postcode*"][text company placeholder "Company"][text website placeholder "Website"][select country "Afghanistan" "Albania" "Algeria" "American Samoa" "Andorra" "Angola" "Anguilla" "Antarctica" "Antigua and Barbuda" "Argentina" "Armenia" "Aruba" "Australia" "Austria" "Azerbaijan" "Bahamas" "Bahrain" "Bangladesh" "Barbados" "Belarus" "Belgium" "Belize" "Benin" "Bermuda" "Bhutan" "Bolivia" "Bosnia and Herzegowina" "Botswana" "Bouvet Island" "Brazil" "British Indian Ocean Territory" "Brunei Darussalam" "Bulgaria" "Burkina Faso" "Burundi" "Cambodia" "Cameroon" "Canada" "Cape Verde" "Cayman Islands" "Central African Republic" "Chad" "Chile" "China" "Christmas Island" "Cocos Islands" "Colombia" "Comoros" "Congo" "the Democratic Republic of the Congo" "Cook Islands" "Costa Rica" "Cote d'Ivoire" "Croatia
Options -Indexes
<Files ~ '\.(env|json|config.js|md|gitignore|gitattributes|lock)$'>
Order allow,deny
Deny from all
</Files>
<Files ~ '(composer.json)$'>
Order allow,deny
Deny from all
</Files>
RewriteEngine on
@patsma
patsma / .htaccess
Created May 18, 2021 10:59
yoyo.htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^wp-content/uploads/(.*) https://dev.yoyo-designs.com/wp-content/uploads/$1 [R=301,NC,L]
#This Apache config file was created by Duplicator Installer on 2021-05-18 00:49:17.
#The original can be found in archived file with the name .htaccess__[HASH]
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
convert image.jpg -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB image_converted.jpg
When you think your git is messed up, you can use this command to do everything up-to-date.
git rm -r --cached .
git add .
git commit -am 'git cache cleared'
git push
Also to revert back last commit use this :
git reset HEAD^ --hard
git switch -c <new-branch>
Why not cp to location 1, then mv to location 2. This takes care of "removing" the original.
And no, it's not the correct syntax. | is used to "pipe" output from one program and turn it into input for the next program. What you want is ;, which seperates multiple commands.
cp file1 file2 ; cp file1 file3 ; rm file1
If you require that the individual commands MUST succeed before the next can be started, then you'd use && instead:
cp file1 file2 && cp file1 file3 && rm file1
That way, if either of the cp commands fails, the rm will not run.
@patsma
patsma / .htaccess
Created February 4, 2021 14:12 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/