Skip to content

Instantly share code, notes, and snippets.

View khmahfuzhasan's full-sized avatar
🏠
Working from home

Khandaker Mahfuz Hasan khmahfuzhasan

🏠
Working from home
View GitHub Profile
@khmahfuzhasan
khmahfuzhasan / .htaccess
Created August 3, 2020 15:22 — forked from hasinhayder/.htaccess
Apache Browser Cache
### marker BROWSER CACHE start ###
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType application/pdf A31557600
ExpiresByType image/x-icon A31557600
ExpiresByType image/vnd.microsoft.icon A31557600
ExpiresByType image/svg+xml A31557600
ExpiresByType image/jpg A31557600
ExpiresByType image/jpeg A31557600
@khmahfuzhasan
khmahfuzhasan / .htaccess
Created August 3, 2020 15:21 — forked from hasinhayder/.htaccess
Apache Deflate
<ifmodule mod_deflate.c>
#DeflateCompressionLevel 9
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
@khmahfuzhasan
khmahfuzhasan / util-elastic-collision.js
Created October 29, 2019 07:27 — forked from christopher4lis/util-elastic-collision.js
A set of utility functions used to reproduce the effect of elastic collision within HTML5 canvas. Used in the Chris Courses tutorial video on collision detection: https://www.youtube.com/watch?v=789weryntzM
/**
* Rotates coordinate system for velocities
*
* Takes velocities and alters them as if the coordinate system they're on was rotated
*
* @param Object | velocity | The velocity of an individual particle
* @param Float | angle | The angle of collision between two objects in radians
* @return Object | The altered x and y velocities after the coordinate system has been rotated
*/