Awesome List Updates on Feb 16 - Feb 22, 2015

13 awesome lists updated this week.

🏠 Home · 🔍 Search · 🔥 Feed · 📮 Subscribe · ❤️ Sponsor

1. Scalable Css Reading List

CSS Styleguides

2. Awesome Swift

Events

3. Awesome Groovy

Language Utilities

4. Android Security Awesome

Tools / App Repackaging Detectors

5. Awesome Android Ui

List / Grid

ViewPager

Animation

Other

6. Awesome Machine Learning

Python / Natural Language Processing

7. Awesome Javascript

Loaders

8. Awesome Remote Job

Articles & Posts

9. Awesome Ruby

Natural Language Processing

10. Awesome Talks

Functional Programming

Cognitive Development

11. Awesome Elixir

Eventhandling

Examples and funny stuff

HTTP

12. Htaccess

Rewrite and Redirection / Force non-www in a Generic Way

Force non-www in a Generic Way

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.
RewriteCond %{HTTPS}s ^on(s)|off
RewriteCond http%1://%{HTTP_HOST} ^(https?://)(www\.)?(.+)$
RewriteRule ^ %1%3%{REQUEST_URI} [R=301,L]

Rewrite and Redirection / Force HTTPS Behind a Proxy

Force HTTPS Behind a Proxy

Useful if you have a proxy in front of your server performing TLS termination.

RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Rewrite and Redirection / Alias a Single Directory

Alias a Single Directory

RewriteEngine On
RewriteRule ^source-directory/(.*) /target-directory/$1 [R=301,L]

Rewrite and Redirection / Alias “Clean” URLs

Alias “Clean” URLs

This snippet lets you use “clean” URLs -- those without a PHP extension, e.g. example.com/users instead of example.com/users.php.

RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^.]+)$ $1.php [NC,L]

Source

Security / Deny Access to Hidden Files and Directories

Deny Access to Hidden Files and Directories

Hidden files and directories (those whose names start with a dot .) should most, if not all, of the time be secured. For example: .htaccess, .htpasswd, .git, .hg...

RewriteCond %{SCRIPT_FILENAME} -d [OR]
RewriteCond %{SCRIPT_FILENAME} -f
RewriteRule "(^|/)\." - [F]

Alternatively, you can just raise a “Not Found” error, giving the attacker no clue:

RedirectMatch 404 /\..*$

Miscellaneous / Auto UTF-8 Encode

Auto UTF-8 Encode

Your text content should always be UTF-8 encoded, no?

# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset utf-8

# Force UTF-8 for a number of file formats
AddCharset utf-8 .atom .css .js .json .rss .vtt .xml

Source (⭐3k)

Miscellaneous / Force Downloading

Force Downloading

Sometimes you want to force the browser to download some content instead of displaying it.

<Files *.md>
    ForceType application/octet-stream
    Header set Content-Disposition attachment
</Files>

Now there is a yang to this yin:

Miscellaneous / Prevent Downloading

Prevent Downloading

Sometimes you want to force the browser to display some content instead of downloading it.

<FilesMatch "\.(tex|log|aux)$">
    Header set Content-Type text/plain
</FilesMatch>

Miscellaneous / Switch to Another PHP Version

Switch to Another PHP Version

If you’re on a shared host, chances are there are more than one version of PHP installed, and sometimes you want a specific version for your website. The following snippet should switch the PHP version for you.

AddHandler application/x-httpd-php56 .php

# Alternatively, you can use AddType
AddType application/x-httpd-php56 .php

13. Awesome Courses

Courses / Systems

Courses / Programming Languages / Compilers

Courses / CS Theory

Courses / Introduction to CS

Courses / Machine Learning

Courses / Misc